假如只有一个iframe
<script>
function refreshFrame( url ){
document.all.tags('iframe')[0].src = url
}
setTimeout("refreshFrame('http://')",30000)
<script>随意写,未测试
<script>
function refreshFrame( url ){
document.all.tags('iframe')[0].src = url
}
setTimeout("refreshFrame('http://')",30000)
<script>随意写,未测试
解决方案 »
- jquery autocomplete 为什么我得到的不是数组而是字符串
- 求高人指点JS table 自增行速度的问题
- jsp页面动态生成元素
- 新手求教$("#play").css("overflow","hidden");啥意思
- 请教:用两个DIV位置关系是平等的。现在请教怎么实现显示后的效果是将其它一个DIV插入到另一个DIV中。
- 高分求助简单问题
- JavaScript中是否可以用isNumeric()函数
- 我的这段脚本代码有什么错吗?
- 请问按原网页表格输出到execl应该怎么做??谁有这方面的例子?????
- 请教一个比较简单的问题,关于如何勾选网站中的复选框的
- 怎样实现"在一个函数里对多个按钮实现翻转效果"?急
- 页面载入的时候,怎样将光标放在一个textarea的最后面?
document.write("<iframe name=box src=http://xxx.xxx.xxx>")
function refreshFrame(){
parent.box.location.href='http://xxx.xxx.xxx';
setTimeout("refreshFrame()",30000);
}
refreshFrame()
<script>
<script>
document.write("<iframe name=box src=http://www.baidu.com width=250 height=200>")
function refreshFrame(){
parent.box.location.reload(true);
}
setTimeout("refreshFrame()",5000);</script>
因为iframe的页面和外面的页面是跨域的页面,所以没有权限访问iframe的window下面的对象,象document,location等,不过可以访问iframe本身的方法或属性,象这样
<script>
document.write("<iframe name=box src=http://www.baidu.com width=250 height=200>")
function refreshFrame(){
document.getElementsByName("box")[0].src = document.getElementsByName("box")[0].src;
}setTimeout("refreshFrame()",1000);</script>
function refreshFrame(){
document.getElementsByName("box")[0].location.reload();
}
reload()函数根本就没有就调用呀?
<script>
document.write("<iframe name=box src=http://www.baidu.com width=250 height=200>")
function refreshFrame(){
parent.box.location.href="http://www.google.com";
}
setTimeout("refreshFrame()",5000);</script>而这样却不能实现刷新:
<script>
document.write("<iframe name=box src=http://www.baidu.com width=250 height=200>")
function refreshFrame(){
parent.box.location.reload();
}
setTimeout("refreshFrame()",5000);</script>请高手指点呀!!!