【发布时间】:2010-10-27 07:31:36
【问题描述】:
这是我第一次使用 jQuery dialog_modal confirmation。 我想在删除 ajax 函数中的数据之前使用它。 我仍然很困惑如何正确放置这个脚本。
在使用此对话框之前,我有一些脚本,例如:
$('#delete').click(function() {
var params = $('#deletedata').serialize();
$.ajax({
async : false,
cache : false,
data : params,
success: function(res) {
// oTable.fnReloadAjax();
$('#recline1').replaceWith("<div id='recline1'></div>");
$('#recmodel1').replaceWith("<div id='recmodel1'></div>");
$('#tabs').hide();
return this;
},
type : "POST",
url : "process1.php",
});
return false;
});
我希望如果单击delete,则会出现此对话框,然后如果我们选择delete at dialog,则删除过程会执行,但如果我们选择no,则所有打开的选项卡都会隐藏。
编辑
我这样试过,可以出现确认对话框:
$('#delete').click(function() {
$('#dialog-confirm').dialog('open');
var params = $('#deletedata').serialize();
....
我仍然对如何在模态确认中获取按钮 id 然后与 ajax 函数结合感到困惑?
【问题讨论】:
标签: jquery ajax modal-dialog confirmation