function loadPage(path,id) {
$.get(path, function(data) {
// data = data.replace(/
data = data.replace(/<\/?link.*>/ig,""); //移除 link 标签
data = data.replace(/<\/?html.*>/ig,""); //移除 html 标签
data = data.replace(/<\/?body.*>/ig,""); //移除 body 标签
data = data.replace(/<\/?head.*>/ig,""); //移除 head 标签
data = data.replace(/<\/?!doctype.*>/ig,""); //移除 doctype 标签
data = data.replace(/
$(id).empty().html(data);//清空contentMain内容并加载html
});
}
//为弹出层增加关闭按钮
$('.ui-dialog-buttonpane').show().empty();
$('').click(function(){
$("#dialogDiv").dialog('close');
return false;
}).appendTo('.ui-dialog-buttonpane');
还是先看例子吧。另外如果要拖动、改变dialog的大小的话要加上ui.draggble.js和ui.resizable.js
代码如下: