I would agree that the best solution is naveen. In my case, the large amount of code that needed to be changed was not cost-effective, since we were in the process of rewriting, and we needed a short-term solution.
You can override the ajax call in the jQuery user interface, I copied the source to call the _initSource function that processes the AJAX request. Then they simply added global: false to the $ .ajax option. The code here is based on jquery-ui 1.9.2, you may have to find the right source for your version.
$.ui.autocomplete.prototype._initSource = function () { var array, url, that = this; if ( $.isArray(this.options.source) ) { array = this.options.source; this.source = function( request, response ) { response( $.ui.autocomplete.filter( array, request.term ) ); }; } else if ( typeof this.options.source === "string" ) { url = this.options.source; this.source = function( request, response ) { if ( that.xhr ) { that.xhr.abort(); } that.xhr = $.ajax({ url: url, data: request, dataType: "json", global: false, success: function( data ) { response( data ); }, error: function() { response( [] ); } }); }; } else { this.source = this.options.source; } };
source share