admin管理员组文章数量:1335386
I have a page, that works fine in FF and IE. However, chrome throws
jquery.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
It's because of trying to process a lot of data (see Chrome RangeError: Maximum call stack size exceeded when using jQuery $.map).
Is it possible to catch
the error, so that the whole page's javascript doesn't hang? Or do I have to reduce the amount of data for chrome.
I have a page, that works fine in FF and IE. However, chrome throws
jquery.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
It's because of trying to process a lot of data (see Chrome RangeError: Maximum call stack size exceeded when using jQuery $.map).
Is it possible to catch
the error, so that the whole page's javascript doesn't hang? Or do I have to reduce the amount of data for chrome.
- I doubt it has to do with trying to process a lot of data; that other question has no answers, and I doubt it was the problem there too. You posted no code, so it's impossible to say what's going on. – Pointy Commented Aug 20, 2012 at 15:42
-
There's no recursion in the code. I think that infinite recursion would crash other browser as well. The fact is, that even ie7 is dealing better than webkit in this situation. Also the question is not about helping me, but about being able to catch the
RangeError
. I don't understand the downvotes... – mreq Commented Aug 20, 2012 at 15:58 - You didn't post any code. You say there's no recursion, but that's obviously the most likely cause of the problem. – Pointy Commented Aug 20, 2012 at 16:03
- Well, I am not asking to get a direct solution for my problem, but rather to see, whether it's possible, to catch the error on global scope. That's the question, if you read the last paragraph. – mreq Commented Aug 20, 2012 at 16:06
-
@PetrMarek Sure:
try..catch
orwindow.onerror
. But, what are you hoping to get out of that other than a solution to the problem? – Jonathan Lonowski Commented Aug 20, 2012 at 16:10
1 Answer
Reset to default 5JavaScript doesn't support Tail Recursion. You're probably calling a function from a function from a function until it blows. (Please post some code to show what you're doing).
Use a setTimeout between 'iterations'. This way you don't block the UI or blow up the stack.
本文标签: javascriptjQuery catch quotRangeError Maximum call stack size exceededquotStack Overflow
版权声明:本文标题:javascript - jQuery catch "RangeError: Maximum call stack size exceeded" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742389561a2465715.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论