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 6a9c2ca commit 5dc41fbCopy full SHA for 5dc41fb
src/jquery.autocomplete.js
@@ -71,6 +71,7 @@
71
containerClass: 'autocomplete-suggestions',
72
tabDisabled: false,
73
dataType: 'text',
74
+ currentRequest: null,
75
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
76
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
77
},
@@ -428,7 +429,10 @@
428
429
if ($.isFunction(options.serviceUrl)) {
430
serviceUrl = options.serviceUrl.call(that.element, q);
431
}
- $.ajax({
432
+ if(this.currentRequest != null) {
433
+ this.currentRequest.abort();
434
+ }
435
+ this.currentRequest = $.ajax({
436
url: serviceUrl,
437
data: options.ignoreParams ? null : options.params,
438
type: options.type,
0 commit comments