diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 80132e2d1..6aefe87d6 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -245,11 +245,22 @@ $.widget( "ui.autocomplete", { if (self.xhr) { self.xhr.abort(); } - self.xhr = $.getJSON( url, request, function( data, status, xhr ) { - if ( xhr === self.xhr ) { - response( data ); + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status, xhr ) { + if ( xhr === self.xhr ) { + response( data ); + } + self.xhr = null; + }, + error: function( xhr ) { + if ( xhr === self.xhr ) { + response( [] ); + } + self.xhr = null; } - self.xhr = null; }); }; } else { |