【发布时间】:2011-08-31 05:54:55
【问题描述】:
我通过单击链接将 AJAX 内容加载到 jquery UI 对话框中,但它似乎不起作用。问题在于弹出窗口,链接返回 ajax 内容很好。试图实现这个example
$.fx.speeds._default = 1000;
$(document).ready(function(){
$( "#dialog" ).dialog({
autoOpen: false,
show: "blind",
hide: "explode"
});
$('#<url_id>').live('click', function(evt) {
//evt.preventDefault();
$.ajaxSetup({
async: false,
"error":function() {
alert("error");
}});
$.getJSON("<url>",
function(data) {
if(data[0][0] != null){
var html = '';
html += '<div id="dialog" title="Basic dialog">';
//concatenating html
html += '</div>';
}
});
$( "#dialog" ).dialog( "open" );
return false;
});
});
【问题讨论】:
标签: ajax jquery-ui jquery-ui-dialog