Script stack space exhausted by firefox

I am working with a great XML response from a web service. When I try to get this using the URL, after a while it displays an error in Firebug that the "script stack quota has been exhausted" How can I solve this?

+3
source share
4 answers

It seems that during the processing of xml, there is some recursion that essentially causes a stack overflow (by any name).

Thoughts:

  • work with less data
  • If you process data manually, try using less recursion? possibly hand tail or queue / stacks
  • json - script
+4

Firebug?

+1
+1

, , . , html jQuery $(html).

Firefox 3.6.16 Windows. Firefox 4.0.1 Ubuntu . , , script 4.x .

:

var $divRoot = $(html);

var $temp = $('<div style="display:none;">');  // .appendTo($('body'));  // (*)
$temp.html(html);  // using the client html parsing
var $divRoot = $('> div', $temp);  // or .children() or whatever
// $temp.remove();  // (*)

(*) , temp node , jquery . , , , .

FF 4.x , FF 3.x.

+1

Source: https://habr.com/ru/post/1710549/


All Articles