繁体   English   中英

更改src时没有刷新浏览器的iframe

[英]iframe without refresh browser when I change src

更改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>

这行是make reload,因为reload = true

删除线,然后正常工作

$('#iframex').get(0).contentWindow.location.reload(true);

据我所知,iframe需要刷新浏览器页面以解析源。 因此,当您更改arcx返回数据的src时,它将刷新页面

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM