1.首先在页面定义一个div
<div id="win"></div>
2.js里处理打开iframe窗口
//打开新窗口
function openNew(){
//请求地址
var url="view?wf_num=V_TEST001_G007";
//高度、宽度
//var width=window.document.documentElement.clientWidth;
//var height=window.document.documentElement.clientHeight;
//alert(width+"-"+height);
var title="新窗口";
window.$('#win').window({
width : 1366,
height : 625,
modal : true,
collapsible:false,
minimizable:false,
maximizable:false,
//closable:false,
draggable:false,
resizable:false,
inline:true,
title : title,
//监听打开窗口之前事件
onBeforeOpen: function () {
window.$('#win').window('vcenter');
},
//监听关闭窗口之前事件
onBeforeClose:function(){
//关闭下一层窗口,刷新当前窗口
window.location.reload();
}
});
//动态加载一个iframe在div里
window.$('#win').html('<iframe width="100%" height="100%" src="' + url + '" frameborder="0" scrolling="no">');
}
3.关闭窗口:在打开的新窗口执行以下代码
//关闭当前弹窗
function closeNew(){
window.parent.$("#win").window('close');
}