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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742389562a4434739.html
评论列表(0条)