问题描述
限时送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:关键词]
发布评论