刚进入页面强制刷新

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);   
  }
}

猜你喜欢

转载自www.cnblogs.com/lmxxlm-123/p/8881716.html
今日推荐