如何防止在Internet Explorer中缓存jQuery Ajax请求? [英] How to prevent a jQuery Ajax request from caching in Internet Explorer?
本文介绍了如何防止在Internet Explorer中缓存jQuery Ajax请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Internet Explorer中阻止jQuery Ajax请求缓存?
How do I prevent a jQuery Ajax request from caching in Internet Explorer?
推荐答案
您可以使用 $。ajaxSetup()
,例如:
You can disable caching globally using $.ajaxSetup()
, for example:
$.ajaxSetup({ cache: false });
这会在发出请求时为查询字符串添加时间戳。为特定的 $。ajax()
在本地调用,设置 cache:false
,如下所示:
This appends a timestamp to the querystring when making the request. To turn cache off for a particular $.ajax()
call, set cache: false
on it locally, like this:
$.ajax({
cache: false,
//other options...
});
这篇关于如何防止在Internet Explorer中缓存jQuery Ajax请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文