Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

(问题很明显不在第0行,而是在我正在写入文档的东西列表中的某个地方。)

Everything works fine in Firefox, so I don't have the delights of Firebug and friends to assist in troubleshooting.

(在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.

(我猜这可能是一个Internet Explorer 7漏洞或者一些相当模糊的东西,我的Google-fu目前给我带来了一些乐趣。)

I can find lots of people who have run into this before, but I can't seem to find how they solved it.

(我之前可以找到很多遇到这种情况的人,但我似乎无法找到他们是如何解决它的。)

  ask by glenatron translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
512 views
Welcome To Ask or Share your Answers For Others

1 Answer

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的深度。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...