This is a note to anyone who uses Ajax and Http GET requests – turn off cache for each request otherwise IE wont refresh and display the latest response. Good example is in JQuery:
$.ajax({ type: 'get', url: url, cache: false, success: function(result) { $(targetDiv).html(result); }
This nice little method allows you to pass a parameter called cache which you need to set to false.
Another method in JScript is to provide dummy URL parameter to fool the old dog into refreshing:
var url = '/accountstest/SiteAdmin/Dashboard' + "?dummy=" + new Date().getTime();
Chrome and Firefox do not have this problem.
Related articles
- Internet Explorer and JQuery/AJAX $.get() not working (stackoverflow.com)
You probably meant ?dummy and not &dummy in the example…
Also, I’ve personally never had a problem with caching, ajax, get and IE if I just set the caching headers.
LikeLike
Thanks Sami! This is all new to me, so im learning as im going. How do you set the cache headers? I presume whatever the JQuery im using for the request only turns off the cache on a request-by-request basis?
Also, ive updated my dummy statement, good spot! 🙂
LikeLike