日期:2014-05-17  浏览次数:20412 次

父页面刷新Iframe怎么只刷新一次 求解
function myrefresh()
{

iframe_content.location.reload(true);



setTimeout('myrefresh()',1000); //指定1秒刷新一次

</script>

<iframe id="iframe_content" onload="checkCookie()" src="chatForm.html" style="width:700px;  height:400px; overflow:hidden; border:none;"></iframe>

checkCookie()是另一个函数  不做考虑
Iframe?刷新

------解决方案--------------------
function myrefresh()
{

iframe_content.location.reload(true);
setTimeout('myrefresh()',1000); 


或者用
setInterval()
------解决方案--------------------
setTimeout 就是一次性的定时器,要么循环用,要么用另一个 setInterval。