You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing this plug-in with Vue-Resource, XHR and Fetch API.
Have you got an example for this JavaScript's vanilla library without using third-party frameworks for requesting REST API's?
The text was updated successfully, but these errors were encountered:
I've used it with a Tiny AJAX library (1KB) called NanonAJAX. Example:
varxhr;varautoCompelete=newautoComplete({selector: "#searchbox",minChars: 2,cache: false,delay: 0,source: function(term,response){try{xhr.abort();}catch(e){}xhr=nanoajax.ajax({url: "queryURL"},function(code,res){varjson=JSON.parse(res);if(typeofjson!="undefined"){if(json.results)response(json.results);// my json has a `results` key}});},renderItem: function(item,search){// Your rendering goes here.}});
P.S. The reason behind using xhr variable is that I needed to abort the request if user has a new key stroke and the AJAX call for the previous query should be aborted. This is very important when you have delay getting data from your server and avoids displaying irrelevant results for a query string.
Referencing #65 and #61
I'm testing this plug-in with Vue-Resource, XHR and Fetch API.
Have you got an example for this JavaScript's vanilla library without using third-party frameworks for requesting REST API's?
The text was updated successfully, but these errors were encountered: