顯示具有 load 標籤的文章。 顯示所有文章
顯示具有 load 標籤的文章。 顯示所有文章

2009年4月13日 星期一

jQuery AJAX on IE does not reflesh

If you use jQuery to implement the AJAX functionality, especially use the "get", "getJSON" and "load", would you encounter one problem on IE, "Ajax" does not really call backend link, but return value immediately".

The problem is the cache of IE. If we use "Get" method to get data from backend, and the parameters are the same, IE won't really get the data. In contrast, FF does not have this problem. The solution is to set cache to false.


$.ajaxSetup({cache: false});
$.get("xxx.jsp",{A=a,B=b},function(){

});


Or, add a parameter with date.

$.get("xxx.jsp",{timestamp:new Date().getTime()},function(){

});