window location href 刷新

頁面刷新類型:

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。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章