错误提示:
jquery.min.js:4 Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'
之前代码
$( "#dialog-modal" ).dialog( "open" );
根据http://api.jqueryui.com/dialog/#option-buttons提示修改为
$( "#dialog-modal" ).dialog({
buttons: [
{
text: "Ok",
icons: {
primary: "ui-icon-heart"
},
click: function() {
$( this ).dialog( "open" );
}
}
]
});