diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/autocomplete/remote-with-cache.html | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/demos/autocomplete/remote-with-cache.html b/demos/autocomplete/remote-with-cache.html index 6f25c5534..bc1de7746 100644 --- a/demos/autocomplete/remote-with-cache.html +++ b/demos/autocomplete/remote-with-cache.html @@ -18,8 +18,7 @@ </style> <script> $(function() { - var cache = {}, - lastXhr; + var cache = {}; $( "#birds" ).autocomplete({ minLength: 2, source: function( request, response ) { @@ -29,11 +28,9 @@ return; } - lastXhr = $.getJSON( "search.php", request, function( data, status, xhr ) { + $.getJSON( "search.php", request, function( data, status, xhr ) { cache[ term ] = data; - if ( xhr === lastXhr ) { - response( data ); - } + response( data ); }); } }); |