gpt4 book ai didi

html - Firefox 中的无限连接循环

转载 作者:行者123 更新时间:2023-11-27 22:34:41 25 4
gpt4 key购买 nike

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script type="text/javascript">
function a(){
for(i=0;i<10;i++)
{
document.write(i);
}
}
</script>
</head>
<body>
<form>
<input type="submit" value="submit" onClick="a();return false;">
</form>
</body>
</html>

在 firefox 选项卡中按下提交按钮时导致无休止的连接;

这是什么原因?有解决办法吗?

最佳答案

因为 firefox 需要一个 document.close(); 如果你写完了。

无休止的连接表明某些事情仍在进行中。

 <script type="text/javascript">
function a(){
for(i=0;i<10;i++)
{
document.write(i);
}
document.close();
}
</script>

关于html - Firefox 中的无限连接循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14733036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com