我收到错误“错误:在初始化之前无法在对话框上调用方法;尝试调用方法'destroy'”。使用的脚本如下所示,我使用的是jquery-ui-1.10.3.js
<script type="text/javascript">
$(function () {
$('a.dialog').live("click", function (event) {
loadDialog(this, event, '#contentGrid');
});
});
function loadDialog(tag, event, target) {
event.preventDefault();
var $url = $(tag).attr('href');
var $title = $(tag).attr('title');
var $dialog = $('<div></div>');
$dialog.empty();
$(this).dialog('destroy').remove();
$dialog
.load($url)
.dialog({
autoOpen: false
, title: 'Skill Request'
, width: 500
, modal: true
, minHeight: 300
, show: 'slide'
, hide: 'scale'
});
$dialog.dialog('open');
};
</script>