if (w && !window.opera){
if (w.contentDocument && w.contentDocument.body.offsetHeight){
w.height = w.contentDocument.body.offsetHeight+40;
}else if(w.Document && win.Document.body.scrollHeight){
w.height = win.Document.body.scrollHeight+40;
}
}
}
2.iframe使用:两种不同的嵌入新页面的方式
方法一:通过一个方法,将新页面的链接放入到iframe中
function preview(frame) {
var myIframe = $(“#frame”);
var url= basePath + “/base/commonFileUpload/preview?id=”+frame+“&split=1”;
$(‘#frame’).attr(‘src’, url);
}
方法二:如果是直接打开一个新窗口展示url生成的页面
window.open(basePath + “/base/commonFileUpload/preview?id=”+frame+“&split=1”);
3.iframe使用:直接设置嵌入新页面链接的方式