I've taken a few approaches to caching responses in the jQuery UI autocomplete widget. A response, in autocomplete parlance, is the data that's displayed when the user is typing in the text input. Each keystroke is a request for data — the response is something the autocomplete must generate by filtering some data source. The filtering operations can be done locally, or remotely. Either way, we stand to benefit from caching these responses.
Showing posts with label wrap. Show all posts
Showing posts with label wrap. Show all posts
Friday, July 4, 2014
Wednesday, January 22, 2014
Preserving Chained Calls Using wrap()
Chained function calls are a staple of jQuery coding style. Rather than make one call, store the resulting jQuery object in a new variable, make another call, etc., we can chain the operations together. It doesn't even have to be the same element. For example, using end(), you can reach deep down into the DOM hierarchy, make a change, then continue along. All in the same call chain. So how does wrap() help us with call chains?
Subscribe to:
Posts
(
Atom
)