急问:如何自动刷新远程网页

joefox 2002-09-20 07:58:14
有个远程网页,http://x/x.asp,如果我几分钟没动,它就踢掉我。
我想自己做个网页把它搞定
在本机上建了一个网页test.htm,想通过它打开子窗口,然后刷新子窗口。
里面写了一段javascript:
function refresh(){
window.open("http://x/x.asp","test");
window.setTimeout("refresh()",5000);
}
refresh();
这样来刷新那个远程网页。
但是我还是被踢掉了。
请问大家有什么方法没有?
...全文
82 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiushuiwuhen 2002-09-22
  • 打赏
  • 举报
回复
不同域不能控制对方的location(安全限制)

只能通过window.open同一个name来刷新
joefox 2002-09-22
  • 打赏
  • 举报
回复
谢谢大家的帮助。
我经过几次测试,发现原来我要刷新的网站不仅仅要求刷新那个页面,而且,
停留在同一个页面时间太长也会被踢掉。
那么就是说window.open是好用的。
onestab的方法我试过,在本机上也可以,但是远程访问我机器的不可以。
joefox 2002-09-22
  • 打赏
  • 举报
回复
我是根据实际操作来看的,因为我用这种方法还是被那个网页给踢了下来。
cleo 2002-09-22
  • 打赏
  • 举报
回复
net_lover的方法为什么不行??
有什么问题??
我不懂?

joefox 2002-09-21
  • 打赏
  • 举报
回复
net_lover的方法和我以前的一样,是行不通的。
onestab的方法我正在试。
emu 2002-09-21
  • 打赏
  • 举报
回复
window.setTimeout("mxh = window.open('http://x/x.asp','test')",5000);
孟子E章 2002-09-20
  • 打赏
  • 举报
回复
var mxh
function refresh(){
mxh = window.open("http://x/x.asp","test");
window.setTimeout("mxh.location.reload()",5000);
}
refresh();
方工 2002-09-20
  • 打赏
  • 举报
回复
对不起,
function refreshIE(){
WshShell.AppActivate(xx.value);
WshShell.SendKeys("{F5}");
}
方工 2002-09-20
  • 打赏
  • 举报
回复
<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>

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧