We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c92f1a6 commit 99a74e1Copy full SHA for 99a74e1
demo.html
@@ -189,11 +189,12 @@ <h4>Optimizing AJAX requests</h4>
189
To further reduce server impact, it's possible to abort unfinished AJAX requests before starting new ones.
190
Again using jQuery's AJAX method for brevity:
191
</p>
192
- <pre class="prettyprint"><code>new autoComplete({
+ <pre class="prettyprint"><code>var xhr;
193
+new autoComplete({
194
selector: 'input[name="q"]',
195
source: function(term, response){
196
try { xhr.abort(); } catch(e){}
- var xhr = $.getJSON('/some/ajax/url/', { q: term }, function(data){ response(data); });
197
+ xhr = $.getJSON('/some/ajax/url/', { q: term }, function(data){ response(data); });
198
}
199
});</code></pre>
200
<p>
0 commit comments