【发布时间】:2010-03-05 07:21:09
【问题描述】:
我创建了这样的对话框
$('#add_error').click(function(e) {
$('<div>')
.load('/someaction/format/html/')
.dialog({
title: 'Some title',
modal: true,
width: 385,
close: function() {
$(this).remove();
}
});
e.preventDefault();
});
它工作正常,但每隔三分之一(不确定是否真的是第三次)我点击链接打开对话框时,它会在 firebug 中失败并出现错误
"$("").addClass("ui-widget-overlay") 未定义"
在 dialog.js 中是一段代码:
var $el = (this.oldInstances.length ? this.oldInstances.splice(0, 1)[0] : $('<div></div>').addClass('ui-widget-overlay'))
.appendTo(document.body)
.css({
width: this.width(),
height: this.height()
});
在create:function(dialog)方法下。
奇怪的是,当我删除时,这个错误并没有发生
close: function() {
$(this).remove();
}
有什么想法吗?
【问题讨论】:
-
您运行的是哪个版本的 JQuery / JQuery UI?