“SCRIPT28: Out of stack space” on website using IE9

后端 未结 4 1719
忘掉有多难
忘掉有多难 2021-01-17 07:56

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 h

相关标签:
4条回答
  • 2021-01-17 08:03

    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?

    0 讨论(0)
  • 2021-01-17 08:13

    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.

    0 讨论(0)
  • 2021-01-17 08:14

    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.

    0 讨论(0)
  • 2021-01-17 08:18

    Check out the msdn page for info on this error. In my case, the error was caused by:

    Your code triggered an event cascade.
    An event cascade is caused by triggering an event that calls an event procedure that's already on the stack. ...

    Basically, I was trying to trigger a click event (using jQuery) on a file upload control using the control's click event. Seems like it would cause infinite recursion. Perhaps you may be having a similar problems with your buttons.

    0 讨论(0)
提交回复
热议问题