So I came up with this script that ajax calls google’s suggestions and JSONP returns the search results. With help from Decad I managed to implement Autocomplete but it appears that I’m stuck on a minor problem which I’ve been trying hard to solve.
When ever I type a letter I get few results, if I select one of those results and rewrite another letter, I get results of the previous selection. It’s like its cached.
Here is the a working fiddle: http://jsfiddle.net/WUcpC/1/
and here is a preview of my problem: http://www.screenr.com/DKBs
Any suggestions and help is appreciated.
Thanks alot
Internet Explorer always caches AJAX calls, while other browsers behave differently. So we’d better tell the browser explicitly whether or not AJAX should be cached. With jQuery, we can accomplish this simply by typing:
Try :