Open HemantChavan opened 9 years ago
Hi,
The above issue was present due to IE ajax call behavior. IE caches ajax call requests. Please see link for more clarification. http://stackoverflow.com/questions/20411043/autocomplete-off-ignored-in-ie I have fixed this issue of cache clear in IE by changing the Remote AJAX settings.
like below
var Remote = function() { "use strict"; function Remote(o) { this.url = o.url; this.prepare = o.prepare; this.transform = o.transform; this.transport = new Transport({ cache: o.cache, limiter: o.limiter, transport: o.transport }); } _.mixin(Remote.prototype, { _settings: function settings() { return { url: this.url, type: "GET", dataType: "json", cache: false /////////Added to clear cache in each ajax call. }; }, get: function get(query, cb) { var that = this, settings; if (!cb) { return; } query = query || ""; settings = this.prepare(query, this._settings()); return this.transport.get(settings, onResponse); function onResponse(err, resp) { err ? cb([]) : cb(that.transform(resp)); } }, cancelLastRequest: function cancelLastRequest() { this.transport.cancel(); } }); return Remote; }();
I am using the latest typeahead library v0.11.1.
var engine = new Bloodhound({ datumTokenizer: function (d) { return Bloodhound.tokenizers.whitespace(d.Name); }, queryTokenizer: Bloodhound.tokenizers.whitespace,
i am unable to clear the remote cache response which i have received. I want to fetch the fresh response on every input click.
Can you please provide me some pointer to clear the previous response and create a new request on each input.