jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – Firefox内部错误:递归过多大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我收到错误内部错误:来自Firefox的过多递归.我正在尝试使用 jquery进行ajax调用.使用Internet Explorer它工作正常.

我没有递归地调用任何函数.

请给我一些建议.谢谢

$(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,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");
           }
      });
 });

谢谢大家的回复

我很抱歉添加整个代码,它引发了很多混乱.

即使这个简单的片段也会产生相同的错误(InternalError:递归太多)
    

$(document).ready(function() {
$("#buttontest123").click(function(evt){
  alert("herepavan");
  evt.preventDefault();

  setPayment();




});

function setPayment()
{   
      alert("here1");
    $.ajax({
        url: 'URL',xhr) {

           alert("sus");
        },errorThrown) {
           alert("err"+errorThrown);
        }
    });


}

});

</script>

解决方法

我认为在newHeader元素中触发元素的click事件会导致更改事件(将被重用)

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

尝试用任何其他逻辑替换上面的行(不要触发’click’,只需调用你想要的代码)

大佬总结

以上是大佬教程为你收集整理的jquery – Firefox内部错误:递归过多全部内容,希望文章能够帮你解决jquery – Firefox内部错误:递归过多所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: