window.onload = function(){ ???????????var url=document.location.href; ?//获取浏览器访问栏里的地址 ???????????if( url.indexOf("times=")==-1 ){ ???//判断地址后面是否多了某些值,没有就进方法里进行刷新 ?????????????????var times = new Date(); ?????????????????if( url.indexOf("?")==-1 ){ ???????????????????window.location.href = url+"?times="+times.getTime(); ?????????????????}else{ ???????????????????window.location.href = url+"×="+times.getTime(); ?????????????????} ???????????} ???????}
首次进入页面的时候用js刷新页面
原文地址:http://www.cnblogs.com/stella1024/p/8109567.html