Javascript 更改源iframe ASP.net
如何在ASP.NET中刷新Iframe,我需要每次更改Iframe页面加载工作中的源代码,请参见示例:Javascript 更改源iframe ASP.net,javascript,asp.net,.net,Javascript,Asp.net,.net,如何在ASP.NET中刷新Iframe,我需要每次更改Iframe页面加载工作中的源代码,请参见示例: document.getElementById('frame1').setAttribute('src', 'Questionair.aspx'); 每次我需要转到'Questionair.aspx'页面并执行页面加载时,在我的代码中,这个源代码更改和页面加载只执行一次 谢谢您可以先设置'src'属性,然后调用location.reload方法重新加载IFrame的源: document.g
document.getElementById('frame1').setAttribute('src', 'Questionair.aspx');
每次我需要转到'Questionair.aspx'页面并执行页面加载时,在我的代码中,这个源代码更改和页面加载只执行一次
谢谢您可以先设置'src'属性,然后调用location.reload方法重新加载IFrame的源:
document.getElementById('frame1').setAttribute('src', 'Questionair.aspx');
document.getElementById('frame1').contentWindow.location.reload(true);