解决方法一:
弹窗部分:
<div id="abcd">
<iframe id="myReportFrame" scrolling="auto" frameborder="0" src="../reportJsp/showReport.jsp?rpx=default"
style="width:100%;height:100%"></iframe>
</div>
js函数
function showData(type,month,teamSort,teamSeq){
var element = document.getElementById('myReportFrame');
element.src = "url";
$('#abcd').dialog({
title: '车辆明细' + month + teamSort + type,
width: 600,
height: 400,
cache: false,
onClose: function (){
//重点这一步,关闭的时候将iframe url清空
element.src = "";
},
buttons: [{
text: '关闭',
handler: function(){
$('#abcd').dialog('close');
}
}]
});
}
解决方法二:
弹窗部分:
<div id="abcd">
</div>
触发弹出Js函数
function showData(type,month,teamSort,teamSeq){
//动态嵌入iframe
$('#abcd').html("<iframe id=\"myReportFrame\"></iframe>");
var element = document.getElementById('myReportFrame');
element.src = "url";
$('#myReportFrame').dialog({
title: '车辆明细' + month + teamSort + type,
width: 600,
height: 400,
cache: false,
onClose: function (){
//重点这一步,销毁弹窗
$('#myReportFrame').dialog('destroy');
},
buttons: [{
text: '关闭',
handler: function(){
$('#myReportFrame').dialog('close');
}
}]
});
}


被折叠的 条评论
为什么被折叠?



