Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript “导致”;此页面上的脚本可能正忙,或者已停止响应。”;Firefox中的错误_Javascript_Firefox - Fatal编程技术网

Javascript “导致”;此页面上的脚本可能正忙,或者已停止响应。”;Firefox中的错误

Javascript “导致”;此页面上的脚本可能正忙,或者已停止响应。”;Firefox中的错误,javascript,firefox,Javascript,Firefox,我用javascript写了一个页面,有1000多行代码,所以页面很重。 当我在firefox上运行页面时,它会告诉我: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://localhost:5070/res

我用javascript写了一个页面,有1000多行代码,所以页面很重。 当我在firefox上运行页面时,它会告诉我:

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: http://localhost:5070/resources/ir.pnusn.branch.ui.pages.BranchMap/scripts/MapAddress.js:151
我在我的地址中有。js:151:

function fillAddress(number)
{
150:    var filedNum=0;
151:    while(document.getElementById("choice4")!=null)
        document.getElementById("choice4").click();
    nextId=1;
    for(i=0;;i++)
    {
        var cookieChoiceName=number+"-"+filedNum+"-0";
        var cookieChoiceValue=getCookie(cookieChoiceName);
        if(cookieChoiceValue==null)
        {
            //alert(document.getElementById("choice4"));
            break;
        }
        var cookieFieldName=number+"-"+filedNum+"-1";
        var cookieFieldValue=getCookie(cookieFieldName);
        if(cookieFieldValue==null)
        {
            alert(document.getElementById("choice4"));
            break;
        }
        if(cookieChoiceValue!= "-1" && cookieChoiceValue!="-2" && document.getElementById("choice"+cookieChoiceValue)!=null)
        {
            document.getElementById("choice"+cookieChoiceValue).click();
        }
        var value=utf8_decode(unescape(cookieFieldValue));
        var finalval=replacePluse(value);
        // var Resvalue=value.substr(1,value.length-1);
        document.getElementById("txt"+(filedNum-1)).value=finalval;
        filedNum++;
    }
}
当我在警告窗口中按continue时,代码正常工作。 但当我在firefox配置文件中增加dom.max_script_run_时间时,它不会改变 在那之后,当我再次按下continue时,它就工作了。
问题出在哪里?如果您想了解有关代码的更多信息,请告诉我在这里为您提供。

从您的代码中,看起来“choice4”的onclick函数应该删除元素,但没有执行


我会检查onclick中是否有bug。

从您的代码中看,'choice4'的onclick函数应该删除元素,但没有这样做


我会在那一次点击中检查一个bug。

你的
,而
可能是一个无限循环。只要存在id为
#choise4
的元素,您使用的条件将始终为真。由于您没有在循环中删除此元素,因此它将永远不会完成。

您的
,而
可能是一个无限循环。只要存在id为
#choise4
的元素,您使用的条件将始终为真。由于您没有在循环中删除此元素,因此它将永远不会结束。

在我看来,这一行可疑地像一个无限循环:

while(document.getElementById("choice4")!=null)
    document.getElementById("choice4").click();

这条线在我看来像是一个无限循环:

while(document.getElementById("choice4")!=null)
    document.getElementById("choice4").click();

当我单击choice4时,它会删除一些项目并删除自身,然后再次创建,以达到第一个条件,而我没有选择4如果它重新创建自身,那么下次当
评估其条件时,它仍将存在,并且您永远不会离开此循环当我单击choice4时,它会删除一些项目并删除自身,然后再次创建以达到第一个条件,我没有选择4如果它自己重新创建,那么下次当
评估它的条件时,它仍然存在,并且你永远不会离开这个循环我不明白你的意思。你能解释更多吗?我不明白你的意思。你能解释更多吗?我想这不是为了无限循环,因为在我添加一些用于禁用某些文本文件到页面的代码之前,它在没有此警告的情况下工作。我认为这不是无限循环,因为在我添加一些用于禁用某些文本文件到页面的代码之前,它在没有此警告的情况下工作。