现在终于找到一个办法啦,就是在 xmlhttp.open 之后发送一个If-Modified-Since头即可, 代码如下
xmlhttp.setRequestHeader('If-Modified-Since', '0');
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("GET", url, true);
xmlHttp.setRequestHeader('If-Modified-Since', '0');
xmlHttp.send(null);
方法二:请求URL后加变化参数
因为IE默认将相同的URL请求进行缓存,所以URL加上唯一区分的参数作为区分,保持每次请求的URL不同,即可绕过IE缓存的问题
js: URL = "http://host/a.php"+"?"+Math.random();
vbs: URL = "http://host/a.php"&"?"&Timer()
//var url = "ResponseContentPageScore.aspx?key=" + Math.round(Math.random() * 100) + "&HotelCD=" + inputContent;
var url = "ResponseContentPageScore.aspx?key=" + new Date().getTime() + "&HotelCD=" + inputContent;
Copyright © 2019- oldu.cn 版权所有 浙ICP备2024123271号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务