I realise this is not the ideal place to ask about this in terms of searchability, but I've got a page whose Javascript code throws "Stack overflow in line 0" errors when I look at it in Internet Explorer.
我发现这不是在可搜索性方面询问这个问题的理想场所,但我有一个页面,当我在Internet Explorer中查看它时,其Javascript代码会引发“第0行堆栈溢出”错误。
The problem is quite clearly not in line 0, but somewhere in the list of stuff that I'm writing to the document. Everything works fine in Firefox, so I don't have the delights of Firebug and friends to assist in troubleshooting.
问题很明显不在第0行,而是在我正在写入文档的东西列表中的某个地方。在Firefox中一切正常,所以我没有Firebug和朋友的乐趣来协助排除故障。
Are there any standard causes for this? I'm guessing this is probably an Internet Explorer 7 bug or something quite obscure, and my Google-fu is bringing me little joy currently. I can find lots of people who have run into this before, but I can't seem to find how they solved it.
这有什么标准的原因吗?我猜这可能是一个Internet Explorer 7漏洞或者一些相当模糊的东西,我的Google-fu目前给我带来了一些快乐。我之前可以找到很多遇到这种情况的人,但我似乎无法找到他们是如何解决它的。
17
You can turn off the "Disable Script Debugging"
option inside of Internet Explorer and start debugging with Visual Studio
if you happen to have that around.
您可以关闭Internet Explorer中的“禁用脚本调试”选项,如果您碰巧使用Visual Studio,则可以使用Visual Studio开始调试。
I've found that it is one of few ways to diagnose some of those IE
specific issues.
我发现它是诊断某些IE特定问题的几种方法之一。
32
I ran into this problem recently and wrote up a post about the particular case in our code that was causing this problem.
我最近遇到了这个问题,并在我们的代码中写了一篇关于导致这个问题的特定情况的帖子。
http://cappuccino.org/discuss/2010/03/01/internet-explorer-global-variables-and-stack-overflows/
http://cappuccino.org/discuss/2010/03/01/internet-explorer-global-variables-and-stack-overflows/
The quick summary is: recursion that passes through the host global object is limited to a stack depth of 13. In other words, if the reference your function call is using (not necessarily the function itself) was defined with some form window.foo = function, then recursing through foo is limited to a depth of 13.
快速摘要是:通过主机全局对象的递归限制为堆栈深度为13.换句话说,如果函数调用正在使用的引用(不一定是函数本身),则使用某种形式window.foo =函数,然后通过foo递归限制为13的深度。
20
Aha!
啊哈!
I had an OnError()
event in some code that was setting the image source to a default image path if it wasn't found. Of course, if the default image path wasn't found it would trigger the error handler...
我在某些代码中有一个OnError()事件,如果找不到它,则将图像源设置为默认图像路径。当然,如果找不到默认图像路径,它将触发错误处理程序...
For people who have a similar problem but not the same, I guess the cause of this is most likely to be either an unterminated loop, an event handler that triggers itself or something similar that throws the Javascript engine into a spin.
对于有类似问题但不相同的人,我猜这个问题的原因很可能是一个未终止的循环,一个触发自身的事件处理程序或者类似的东西,它会引发Javascript引擎。
7
I had this problem, and I solved it. There was an attribute in the <%@ Page
tag named MaintainScrollPositionOnPostback
and after removing it, the error disapeared. I added it before to prevent scrolling after each postback.
我有这个问题,我解决了。 <%@ Page标记中有一个名为MaintainScrollPositionOnPostback的属性,删除后,错误消失了。之前我添加了它以防止每次回发后滚动。
3
If you came here because you had the problem inside your selenium tests: IE doesn't like By.id("xyz")
. Use By.name, xpath, or whatever instead.
如果你来到这里是因为你的硒测试中存在问题:IE不喜欢By.id(“xyz”)。请使用By.name,xpath或其他任何内容。
2
Also having smartNavigation="true" causes this"
也有smartNavigation =“true”导致这个“
2
I set up a default project and found out the following:
我设置了一个默认项目,发现了以下内容:
The problem is the combination of smartNavigation and maintainScrollPositionOnPostBack. The error only occurs when both are set to true.
问题是smartNavigation和maintainScrollPositionOnPostBack的结合。仅当两者都设置为true时才会发生错误。
In my case, the error was produced by:
就我而言,错误产生于:
Any other combination works fine.
任何其他组合工作正常。
Can anybody confirm this?
任何人都可以证实吗?
1
display a notification about every script error
显示有关每个脚本错误的通知
1
My was "at line 1" instead but...
我是“在第1行”而是......
I got this problem when using jQuery's .clone
method. I replaced these by using making jQuery objects from the html string: $($(selector).html())
.
使用jQuery的.clone方法时遇到了这个问题。我通过使用来自html字符串的jQuery对象替换了这些:$($(selector).html())。
1
I have reproduced the same error on IE8. One of the text boxes has some event handlers to replace not valid data.
我在IE8上重现了同样的错误。其中一个文本框有一些事件处理程序来替换无效数据。
$('.numbersonly').on("keyup input propertychange", function () {
//code
});
The error message was shown on entering data to this text box. We removed event "propertychange" from the code above and now it works correctly.
输入此文本框的数据时显示错误消息。我们从上面的代码中删除了事件“propertychange”,现在它正常工作。
P.S. maybe it will help somebody
附:也许它会帮助别人
0
I don't know what to tell you, but the same problem occured with jQuery table sorting and SEARCH. When there is nothing left in the table, where you are searching a string for example, you get this error too. Even in Google Analytics this error occurs often.
我不知道该告诉你什么,但jQuery表排序和SEARCH也出现了同样的问题。如果表格中没有任何内容,例如您正在搜索字符串,那么您也会收到此错误。即使在Google Analytics中,也会经常出现此错误。
0
In my case I had two functions a()
and b()
. First was calling second and second was calling first one:
在我的例子中,我有两个函数a()和b()。第一个叫第二个,第二个叫第一个:
var i = 0;
function a() { b(); }
function b() {
i++;
if (i <30) {
a();
}
}
a();
I resolved this using setTimeout
:
我使用setTimeout解决了这个问题:
var i = 0;
function a() { b(); }
function b() {
i++;
if (i <30) {
setTimeout( function() {
a();
}, 0);
}
}
a();
-16
This is problem with Java and Flash Player. Install the latest Java and Flash Player, and the problem will be resolved. If not, then install Mozilla Firefox, it will auto install the updates required.
这是Java和Flash Player的问题。安装最新的Java和Flash Player,问题将得到解决。如果没有,那么安装Mozilla Firefox,它将自动安装所需的更新。