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

时间:2015-01-14 14:07:31   收藏:0   阅读:955
<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;
    alert(23445)
  }
  document.getElementById("refresh").onclick = function(){
    convertURL()
  };
</script>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!