超出了最大调用堆栈大小.在对话框中打开

编程入门 行业动态 更新时间:2024-10-26 02:37:48
本文介绍了超出了最大调用堆栈大小.在对话框中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

在我的项目中,我有一个对话框,显示两个按钮(确认和取消)操作.但是当出现这种情况时,如果我移动或单击具有与我关联的功能的按钮会导致此错误:

<块引用>

未捕获的范围错误:超出最大调用堆栈大小.

这是显示对话框的功能:

displayConfirmMessageBox: function(title, message, messageButtons) {if(title == undefined || title == ''){title = "<无消息>";}if(message == undefined || message == ''){message = "<无消息>";}如果(消息按钮 == 未定义){消息按钮 = {};messageButtons[EALang['close']] = function(){jQuery("#message_box_confirm").dialog("close");};}jQuery("#message_box_confirm").dialog("destroy");jQuery("#message_box_confirm").remove();jQuery("body").append("<div id='message_box_confirm' title='" + title + "'>"+<p>"+ 消息 + "</p>"+</div>");jQuery("#message_box_confirm").dialog({自动打开:假,模态:真,调整大小:自动",宽度 : 400,高度:自动",可调整大小:假,按钮:消息按钮,closeOnEscape : 真});jQuery("#message_box_confirm").dialog("open");jQuery(".ui-dialog .ui-dialog-buttonset 按钮").addClass('btn');jQuery("#message_box_confirm .ui-dialog-titlebar-close").hide();},

这是调用displayConfirmMessageBox的函数:

var messageButtons = {};messageButtons['OK'] = function(){conferma = 真;BackendCalendarpleteAppointmentStore(conferma, successCallback, errorCallback);};messageButtons[EALang['cancel']] = function(){conferma = 假;$('#message_box_confirm').dialog('close');};GeneralFunctions.displayMessageBox(EALang['delete_resource_confirmation'],EALang['warning_resource'],消息按钮);

我做错了什么?

解决方案

Fixed with modal: true on modal:false (更好的方法是删除此参数).

In my project I've a dialog that display two buttons (confirm and cancel) the action. But when this appears, if I move or I click on a button with a function associated with me cause this error:

Uncaught RangeError: Maximum call stack size exceeded.

This is the function that display the dialog:

displayConfirmMessageBox: function(title, message, messageButtons) {
    if(title == undefined || title == ''){
        title = "<No message>";
    }   
    if(message == undefined || message == ''){
        message = "<No message>";
    } 
    if(messageButtons == undefined){    
        messageButtons = {};
        messageButtons[EALang['close']] = function(){   
            jQuery("#message_box_confirm").dialog("close");
        };
    }

    jQuery("#message_box_confirm").dialog("destroy");
    jQuery("#message_box_confirm").remove();
    jQuery("body").append(
        "<div id='message_box_confirm' title='" + title + "'>" +
        "<p>" + message + "</p>" +
        "</div>"
    );    

    jQuery("#message_box_confirm").dialog({
        autoOpen      : false,
        modal         : true,
        resize        : "auto",
        width         : 400,
        height        : "auto",
        resizable     : false,
        buttons       : messageButtons,
        closeOnEscape : true
    });

    jQuery("#message_box_confirm").dialog("open"); 
    jQuery(".ui-dialog .ui-dialog-buttonset button").addClass('btn');
    jQuery("#message_box_confirm .ui-dialog-titlebar-close").hide();
},

and this is the function that call the displayConfirmMessageBox:

var messageButtons = {};

messageButtons['OK'] = function(){
    conferma = true;
    BackendCalendarpleteAppointmentStore(conferma, successCallback, errorCallback);
};

messageButtons[EALang['cancel']] = function(){
    conferma = false;
    $('#message_box_confirm').dialog('close');
};

GeneralFunctions.displayMessageBox(
    EALang['delete_resource_confirmation'], 
    EALang['warning_resource'], 
    messageButtons
);

What am I doing wrong?

解决方案

Fixed with modal: true on modal:false (better way delete this parameter).

这篇关于超出了最大调用堆栈大小.在对话框中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-23 08:27:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1039148.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:堆栈   大小   对话框中   超出了

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!