“`” 参考回答:

在ajax发送请求前加上 anyAjaxObj.setRequestHeader(""If-Modified-Since"",""0"")。

在ajax发送请求前加上 anyAjaxObj.setRequestHeader(""Cache-Control"",""no-cache"")。

在URL后面加上一个随机数: ""fresh="" + Math.random()。

在URL后面加上时间搓:""nowtime="" + new Date().getTime()。

如果是使用jQuery,直接这样就可以了 $.ajaxSetup({cache:false})。这样页面的所有ajax都会执行这条语句就是不需要保存缓存记录。

<pre><code> "“`

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.