微信客户端浏览器中添加时间戳骗过浏览器缓存

<button id="refresh" style="position: fixed;top: 50px;left: 50px">刷新一发</button>
<script>
function convertURL(){
var url = location.href;
var timstamp = (new Date).valueOf();
if (url.indexOf("?")>=0){
url = url + "&ts=" + timstamp;
}else {
url = url + "?ts=" + timstamp;
}
location.href = url;
}
document.getElementById("refresh").onclick = function(){
convertURL()
};
</script>

 

posted @ 2015-01-14 13:38  红河小鱼  阅读(1121)  评论(0编辑  收藏  举报