码迷,mamicode.com
首页 > Windows程序 > 详细

window location href 刷新

时间:2014-07-03 15:07:19      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:window   frame   

页面刷新类型:

1、window.location.reload 刷新。

   window.location.reload()与window.location.href=window.location.href都可以刷新页面

   注:

      window.location.reload()刷新页面时,页面若有数据提交会提示是否提交数据,就是我们经常看到的那个讨厌的提示框。window.location.href=window.location.href则不会。

2、frame框架刷新。

代码如下:

<html>

 <head>

  <title> 右边框 </title>  

  <script type="text/javascript">


 function doResh(){

     window.parent.frames["leftfr"].location = "http://www.baidu.com";

 }


  </script>  

 </head>

 <body>

   <b>右边框</b>

   <input type="button"  onClick="doResh();" value="刷新"/>

 </body>

</html>


记住:

    window.location.href的要点,window, parent,opener。

window location href 刷新,布布扣,bubuko.com

window location href 刷新

标签:window   frame   

原文地址:http://q1ngp2ng.blog.51cto.com/1123150/1433601

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!