如何美元的浏览器p $ pvent的Ajax / JavaScript的结果缓存? [英] How to prevent Ajax/javascript result caching in browsers?

查看:152
本文介绍了如何美元的浏览器p $ pvent的Ajax / JavaScript的结果缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何prevent浏览器缓存从阿贾克斯的结果?我和事件的结果显示只有在浏览器中的数据已被清除触发的Ajax脚本。

How to prevent browsers from caching Ajax results? I have and event triggered Ajax script the displays results only when the browsers data has been cleared.

经过测试,在IE6和Firefox 3.0.10

推荐答案

添加一个随机的查询字符串给您发送的网址。

Add a random query string to the URL you are sending.

例如。如果Ajax请求被发送到http://www.xyz.com/a http://www.xyz.com/a?q=39058459ieutm39

E.g. if the Ajax request is sent to "http://www.xyz.com/a" then add a random string at the end: "http://www.xyz.com/a?q=39058459ieutm39"

这篇关于如何美元的浏览器p $ pvent的Ajax / JavaScript的结果缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆