【发布时间】:2014-09-05 16:22:30
【问题描述】:
当用户单击下面模式上的“取消”按钮时,我正在尝试添加提示。 它会提示他们确认操作。下面的代码是我目前尝试的。
function ShowAddEditExecutive() {
$("#addEditExecutive").dialog({
modal: true,
width: 800,
appendTo: "form",
open: function () {
$(this).dialog("widget").find(".ui-dialog-titlebar").show();
// Removes the do you want to leave this page dialog.
window.onbeforeunload = null;
// The two isplalines below are 2 different ways to ensure the
// background is completely grayed out if the modal is larger
// then the page. The first was chosen so that the scroll
// bars are not disabled.
$('.ui-widget-overlay').css('position', 'fixed');
//$('body').css('overflow', 'hidden');
},
buttons: {
"Add/Edit Executive Information": function () {
$("[id*=btnAddEditExecutive]").click();
},
"Cancel": function () {
$(this).dialog("close");
}
},
close: function (ev, ui) {
// Ensures when you cancel that the values are not retained.
$(this).remove();
// The two lines below are 2 different ways to ensure the
// background is completely grayed out if the modal is larger
// then the page. The first was chosen so that the scroll
// bars are not disabled.
$('.ui-widget-overlay').css('position', 'absolute');
//$('body').css('overflow', 'inline');
},
});
}
【问题讨论】:
-
代码有什么问题?
-
这段代码没有问题,我正在努力让“取消”按钮弹出一个确认窗口。
标签: javascript jquery asp.net prompt