(小技巧)刷新页面一定次数后自动 转到登录界面

刷新页面一定次数后自动 转到登录界面

<script>
if(window.name==""){
  window.name 
= "0";
}

else{
  window.name 
= eval(window.name) + 1;
  
if(window.name=="5")  //刷新页面次数>5
  {
      alert(
"You have refreshed 5 times. Please relogin");
      location.href 
= "http://bbs.51js.com/"
  }

  alert(
"You have refreshed "+ window.name+' time(s)');
}

</script>


(来自51js
Bencalie)
posted @ 2007-11-03 17:36  过河卒A  阅读(953)  评论(2编辑  收藏  举报