<html>
<head>
<title>自动刷新IE窗口 </title>
<script language="JScript">
 var timer =null;
 var WshShell =  new ActiveXObject("WScript.Shell");function refreshIE(){
 WshShell.AppActivate("CSDN_专家门诊");
 WshShell.SendKeys("{F5}");
}
function start(){
 if(timer==null) refreshIE();
 sss = parseInt(min.value);
 if(isNaN(sss) || sss<0) return;
 timer = setInterval(refreshIE, sss*1000)
}
function stopRe(){
 if(timer)
  clearInterval(timer);
  timer=null;
}
</script>
</head>
<body><h1>自动刷新IE窗口</h1>
输入你要刷新的窗口标题(能区分出来即可,不必完全相同):<br>
<input id=xx size=30 type=text value="CSDN_专家门诊"><br>
时间间隔(秒钟):<input id=min type=text size=10 value=60><br>
<button onclick="start()">开始</button> <button onclick="stopRe()">停止</button>
</body>
</html>

解决方案 »

  1.   

    对不起,
    function refreshIE(){
     WshShell.AppActivate(xx.value);
     WshShell.SendKeys("{F5}");
    }
      

  2.   

    var mxh
    function refresh(){
    mxh = window.open("http://x/x.asp","test");
    window.setTimeout("mxh.location.reload()",5000);
    }
    refresh();
      

  3.   

    net_lover的方法和我以前的一样,是行不通的。
    onestab的方法我正在试。
      

  4.   

    window.setTimeout("mxh = window.open('http://x/x.asp','test')",5000);
      

  5.   

    net_lover的方法为什么不行??
    有什么问题??
    我不懂?
      

  6.   

    不同域不能控制对方的location(安全限制)只能通过window.open同一个name来刷新
      

  7.   

    谢谢大家的帮助。
    我经过几次测试,发现原来我要刷新的网站不仅仅要求刷新那个页面,而且,
    停留在同一个页面时间太长也会被踢掉。
    那么就是说window.open是好用的。
    onestab的方法我试过,在本机上也可以,但是远程访问我机器的不可以。