解决jQuery在ie下JSON的cache问题

ie会cache jQuery的get请求, 导致jQuery的getJSON的失败, 有两种解决方案:

    $.post(url, data, callback, "json");

}

1. 服务器端设置http header: Cache-Control: no-cache

 

2. 用POST方式定义 JSON调用 

$.postJSON = function(url, data, callback) {

然后用postJSON 替代 getJSON即可

 

3. 在get请求之后增加一个随机的参数

 

你可能感兴趣的:(jquery,json,cache,IE,callback,getjson)