Last Updated: February 25, 2016
·
995
· darhazer

IE8: do not use recursion when working with DOM

It seems IE8 has really small stack for recursion on global objects (and DOM is global). My use case is recursively getting children of a node and I got stackoverflow at simple HTML. After some research it looks like you can get only 12 levels deep so I rewrite it as iterative function. You can see the result here