如何防止在Internet Explorer中缓存jQuery Ajax请求?如何在Internet Explorer中阻止jQuery Ajax请求缓存?
3 回答

慕桂英3389331
TA贡献2036条经验 获得超8个赞
您可以使用全局禁用缓存$.ajaxSetup()
,例如:
$.ajaxSetup({ cache: false });
这会在发出请求时向查询字符串附加时间戳。要为特定$.ajax()
呼叫关闭缓存,请cache: false
在本地设置它,如下所示:
$.ajax({ cache: false, //other options... });

互换的青春
TA贡献1797条经验 获得超6个赞
如果设置了唯一参数,则缓存不起作用,例如:
$.ajax({ url : "my_url", data : { 'uniq_param' : (new Date()).getTime(), //other data }});
- 3 回答
- 0 关注
- 413 浏览
添加回答
举报
0/150
提交
取消