读书人

做了一个刷新按钮 要求和F5一个效果 用

发布时间: 2012-02-11 09:51:35 作者: rapoo

做了一个刷新按钮 要求和F5一个效果 用js怎么写呀
<input type= "button " name= "renovates " value= "刷新 " onclick= "renovates() "/>

<script>
function renovates(){
window.opener.document.location.reload();
}
</script>

怎么弄都不行

[解决办法]
window.document.location.reload();

or
window.top.document.location.reload();

[解决办法]
<input type= "button " name= "renovates " value= "刷新 " onclick= "renovates() "/>

<script>
function renovates(){
document.location.reload();
}
</script>
[解决办法]
reload(true);//从服务器上下载新的,默认为false,从缓存中取。
[解决办法]
window.self.location.reload();
[解决办法]
ls的几种方法都试过了 还是不行 T_T
==================================

8会吧?

t.htm
<input type= "text ">
<input type= "button " value= "open " onclick= "window.open( 'o.htm ', ' ', 'width=200,height=100 '); ">

o.htm
<input type= "button " name= "renovates " value= "刷新 " onclick= "renovates() "/>

<script>
function renovates(){
window.opener.document.location.reload();
}
</script>

在t.htm的文本框随便输入,再open,再open开的页点[刷新]看看!

读书人网 >JavaScript

热点推荐