【发布时间】:2015-08-12 04:14:44
【问题描述】:
我有一个 div,其中包含一些内容,以及该 div 区域中的几个选项。 div 和它的选项点击事件将随着 Ajax 调用而更新。我在这个 div 中有两个按钮,当出现问题时,它们必须弹出不同的警报框。一个对话框包含以下选项。
$("#dialog").dialog({
autoOpen: false,
resizable: true,
height: 400,
width: 150,
position: 'center',
title: 'Term Sheet',
beforeClose: function(event, ui) {
console.log('Event Fire');
},
modal: true,
buttons: {
"Submit": function() {
$(this).dialog("close");
},
"Run": function() {
Gosomewhere();
},
"Create": function() {
dosomething();
}
}
});
如果我点击了第一个按钮并在打开的对话框中选择了“提交”选项。接下来,如果我单击 div 中的另一个按钮,它会打开上一个对话框,而不是我在该按钮事件中编写的新普通对话框,例如,
alert("some message");// but here i get the previous dialog box with three buttons and message content as "some message"
我可以尝试在此按钮事件中弹出带有警报的新对话框吗?
【问题讨论】:
标签: javascript jquery html