【发布时间】:2010-10-25 15:28:11
【问题描述】:
根据下面显示 JQuery 对话框的代码,按钮文本显示为文字“b”,而不是变量 b 的值。
即:showWarningDialog('myBody', 'myTitle', 'go') 显示一个对话框,其中包含一个标记为 b 而不是 go 的按钮。
如何让go 出现?
function showWarningDialog(theBody, theTitle, buttonText) {
var t = "Warning";
if (theTitle != null) {
t = theTitle;
}
var b = "Ok";
if (buttonText != null) {
b = buttonText;
}
$("#div-dialog-warning div").text(theBody);
$("#div-dialog-warning").dialog({
title: t,
resizable: false,
height: 160,
modal: true,
buttons: {
b : function () {
$(this).dialog("close");
}
}
});
}
【问题讨论】:
标签: jquery jquery-ui modal-dialog jquery-ui-dialog