Javascript 如何在php页面中刷新iframe

Javascript 如何在php页面中刷新iframe,javascript,html,iframe,Javascript,Html,Iframe,可能重复: <meta http-equiv="refresh" content="1" /> 我需要从源代码中刷新php页面上的iframe,由 src = "<?php echo site_url();?>/information" <meta http-equiv="refresh" content="1" /> src=“/information” 我希望经常这样做,比如说每1秒或2秒 <meta http-

可能重复:

    <meta http-equiv="refresh" content="1" />
我需要从源代码中刷新php页面上的iframe,由

src = "<?php echo site_url();?>/information"  
    <meta http-equiv="refresh" content="1" />
src=“/information”
我希望经常这样做,比如说每1秒或2秒

    <meta http-equiv="refresh" content="1" />

正在寻找一种在JavaScript中执行此操作的方法,我可以搜索iframe的id并刷新它。

如果您正在寻找一种在不启用JavaScript的情况下执行此操作的方法,并且有权修改iframe HTML,则可以将此重新加载代码添加到iframe HTML的
标记中:

<meta http-equiv="refresh" content="600">
    <meta http-equiv="refresh" content="1" />

Javascript方式:

 setInterval(refreshIframe,1000);

 function refreshIframe() {
    window.frames["myframe"].src = window.frame["myframe"].src;
 } 

 <iframe src="/information" name='myframe' id='myframe'></iframe>
    <meta http-equiv="refresh" content="1" />
setInterval(刷新帧,1000);
函数refreshIframe(){
window.frame[“myframe”].src=window.frame[“myframe”].src;
} 
元标记方式:

    <meta http-equiv="refresh" content="1" />


无功定时器;
函数refreshIframe(){
中频(定时器)
清除间隔(计时器)
定时器=设置超时(刷新帧,5000)
var iframe=document.getElementById('iframe');
iframe.src=http://google.com';
}
刷新帧();
您的浏览器不支持iFrame

    <meta http-equiv="refresh" content="1" />

演示:

php在这里帮不上忙。你为什么问同样的问题两次?
    <meta http-equiv="refresh" content="1" />