刚进入页面强制刷新

window.onload  =   function() { 
  /*
  加时间戳 ==>最好是时间戳
  var timestamp = Date.parse(new Date());
  var timestamp = (new Date()).valueOf();
  var timestamp=new Date().getTime();
  */
  if (location.search.indexOf("?") == -1) {    //判断是否含有‘?’
    location.href  +=  "?myurl=" + Math.random(100);   
  }   
  else {      
    if (location.search.indexOf("myurl") == -1)  location.href  +=  "&myurl=" + Math.random(100);   
  }
}

posted @ 2018-04-19 12:33  豆豆飞  阅读(701)  评论(0编辑  收藏  举报