"SCRIPT28: Out of stack space" on website using IE9 "SCRIPT28: Out of stack space" on website using IE9 asp.net asp.net

"SCRIPT28: Out of stack space" on website using IE9


As people said in comments: it means that infinite recursion takes place. Whether it is simple recursion or some devious path across code like a serpent biting its tail - unknown, it seems IE gives out no stacktrace, or does?


I've reproduced this issue when I'm doing the following code:

HTML

<span class="search-icon"><input title="search" type="submit" value=""></span>

JS

(function($) {    $('.search-icon').on('click', function(e) {        // The click event will call  $('.search-icon').on('click', function(e) { .. } for every time        // which make an infinte loop in click event as long as there are no stop condition added here.        $(this).find('input').click();    });})(jQuery);

I've solve this problem by changing my JS code to be:

(function($) {        $('.search-icon').on('click', function(e) {            $(this).closest('form').submit();        });})(jQuery);

I hope this answer will be helpfull for you.


Can you post the code / a link to the code, or close this issue?

Common problems: you might have a closure problem in the html, thus different browsers interpret the html hierarchy differently, or you might be looping through a for(x in y) where x contains a backreference to y.