I am working with a large XML response from a web service. When I try to get that using a URL, after some time it displays an error in Firebug that "script stack space quota is exhausted" How can i resolve that?
It sounds like there is some recursion going on when processing the xml, that is essentially causing a stack overflow (by any name).
Thoughts:
Have you tried disabling Firebug?
As of Firefox 3, the available stack space has dropped from 4MB to ~= 640KB (I'm passing on word of mouth here).
Do you happen to be running FF3?
I had a similar problem, maybe the same. This can happen if you try to parse a huge chunk of html with jQuery $(html).
In my tests this only happened on Firefox 3.6.16 on Windows. Firefox 4.0.1 on Ubuntu behaved much better. Probably nothing to do with the OS, just the script engine in 4.x is much better..
Solution: Instead of
var $divRoot = $(html);
I did
var $temp = $('<div style="display:none;">'); // .appendTo($('body')); // (*)
$temp.html(html); // using the client's html parsing
var $divRoot = $('> div', $temp); // or .children() or whatever
// $temp.remove(); // (*)
(*) I remember that in some cases you need to add the temp node to the body, before jquery can apply any selectors. However, in this case it seemed to work just fine without that.
There was absolutely no difference on FF 4.x, but it did allow to avoid the stack space overflow error on FF 3.x.