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

后端 未结 4 1816
忘掉有多难
忘掉有多难 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:13

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

    HTML

    
    

    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.

提交回复
热议问题