Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am having an issue where all link button controls on my page do not work once we deploy our website to our production server. Here are a few details:

  1. We have 3 environments upon which we develop: Our local Machine, which uses local IIS7 to run for development; test environment which is an actual webserver behind our firewall(IIS6); Production which is our live webserver(IIS6). The website works fine on local machines and test server but once we click a link button on production server it hangs.

  2. The problem does not exist in Chrome, or FireFox it only exists in IE9. It does not exist when you put IE9 in compatibility mode.

  3. If I use the IE9 Developer tool bar and watch the scripts, as soon as you click one of the link buttons the console shows this error:

SCRIPT28: Out of stack space , line 340 character 9

  1. I am using quite a bit of JQuery and am wondering if this is causing an issue: However, I see no javascript errors.

Any thoughts? Thanks for any suggestions.

like image 750
MissioDei Avatar asked Jun 08 '11 14:06

MissioDei


3 Answers

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?

like image 172
dmitry Avatar answered Nov 03 '22 20:11

dmitry


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.

like image 41
Ahmad AlMughrabi Avatar answered Nov 03 '22 22:11

Ahmad AlMughrabi


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.

like image 22
ledlogic Avatar answered Nov 03 '22 21:11

ledlogic