Firefox Internal Error: Recursion Too Big

I get the error Internal Error: too much recursion from Firefox. I am trying to make an ajax call using jquery. It works fine with Internet Explorer.

I do not call any function recursively.

Please give me some suggestion. Thanks

  $(function(){ $('#delivery').accordion({ header: '.accTrigger', autoHeight: false, animated: 'easeslide', change: function(event, ui) { alert("here"); event.preventDefault(); $.ajax({ url: URL, type: 'GET', dataType: 'html', timeout: 18000, success: function(data, textStatus, xhr) { alert("sus"); }, error: function(xhr, textStatus, errorThrown) { alert("err" + errorThrown); } }); $("input",ui.newHeader).prop("checked","checked"); $("input",ui.newHeader).trigger('click'); $(".accSection").each(function() { $(this).removeClass("active"); }); ui.newHeader.parent().addClass("active"); fitContentBackground(); } }); /** * Loop through all the payment types and enable the respective accordin */ $.each($('.accSection'), function(index, value) { if ($('input[type="radio"]', value).is(':checked') == true) { $('#delivery').accordion('activate',index); $(this).addClass("active"); } else { $(this).removeClass("active"); } }); }); 

Thank you all for your reply.

I apologize for adding all the code, it caused so much confusion.

Even this simple snippet also generates the same error (InternalError: recursion too large)

 $(document).ready(function() { $("#buttontest123").click(function(evt){ alert("herepavan"); evt.preventDefault(); setPayment(); }); function setPayment() { alert("here1"); $.ajax({ url: 'URL', type: 'GET', dataType: 'html', success: function(data, textStatus, xhr) { alert("sus"); }, error: function(xhr, textStatus, errorThrown) { alert("err"+errorThrown); } }); } }); </script> 
+4
source share
1 answer

I think that triggering a click event for an element in a newHeader element will trigger a change event (which will be distracted)

  $("input",ui.newHeader).trigger('click'); 

try replacing the above line with any other logic (don't run 'click', just call the code you need)

+3
source

Source: https://habr.com/ru/post/1445940/


All Articles