更改 iframe src 时如何防止浏览器不刷新?
脚本加载 iframe:
function load(page, iframe){
var image_load = "<div class='ajax_loading'><img src='"+loading_image_large+"' /></div>";
$.ajax({
url: site+page,
dataType: 'json',
type :'POST',
dataType:"html",
beforeSend: function(){
$(div).html(image_load);
},
success: function(response){
$(iframe).attr('src', "http://192.168.1.13:8080/server/flow.html?_flowId=viewReportFlow&standAlone=true&reportUnit="+ Product.uri +"&j_username=joeuser&j_password=joeuser");
}
});
}
html:
$('#iframex').get(0).contentWindow.location.reload(true);
//html
<iframe id="iframex" frameborder="0"></iframe>