【发布时间】:2012-01-27 02:17:25
【问题描述】:
这是一个示例代码。
$(".remove.group").live("click", function (ev) {
var button = $(ev.currentTarget);
var action = button.get(0).dataset["action"];
var method = button.get(0).dataset["method"];
var modal = $("#remove");
modal.find(".primaryaction").bind("click", function (e) {
$.ajax({
url: action,
type: method,
dataType: "xml",
success: function (rawResponse, status, xhr) {
//some business logic
$.nmTop().close();
},
error: function (xhr) {
console.log(arguments);
var message = "Could not remove group";
alert(message);
$.nmTop().close();
}
});
});
modal.find(".cancelButton").bind("click", function (e) {
$.nmTop().close();
});
$.nmManual("#remove");
return false;
});
我在这里使用nyroModal 和 jQuery。
所有点击事件第一次正常工作。但是,如果我再次重新打开模式并单击任一按钮,nyroModal 最终会引发错误:
this.elts.cont 未定义
【问题讨论】: