【发布时间】:2013-05-18 07:03:14
【问题描述】:
有人能解释一下为什么这个简单的代码可以在基于 webkit 的浏览器(甚至是我的安卓手机)中运行,但不能在 Firefox 上运行吗? (代码基本上每 1000 毫秒刷新一个 iframe(一个 bash 脚本回显到该文件))
此代码的网站是http://haenh.ddns.us/ui/content/servinfo,它嵌入在:http://haenh.ddns.us/ui/?page_id=2(firefox 中的第一个链接我必须手动刷新,而第二个链接显示旋转的绿色圆圈(表明它正在下载内容)。在 chrome/webkit 中,这正如预期的那样令人耳目一新)
<html>
<head>
<script>
function a(){
document.close();
document.write('<br><p align="center"><iframe src="/serv.txt" width="700" height="2000" scrolling="no" frameborder="0"<> <p>Failed</p> </iframe></p><br><br>');
setTimeout('a()', 1000);
// the old one was 15000
}
</script>
</head>
<body onLoad="a()">
<title>ServInfo</title>
<br>
JS is required.
</body>
</html>
【问题讨论】:
标签: javascript google-chrome firefox webkit