Javascript - 페이지 새로 고침 의 다양한 방법

Javascript         :

1    history.go(0)

2    location.reload()

3    location=location

4    location.assign(location)

5    document.execCommand('Refresh')

6    window.navigate(location)

7    location.replace(location)

8    document.URL=location.href

 

         :

1.      :       <head>   

<meta http-equiv="refresh" content="20">

  20   20       .

2.      :       <head>   

<meta http-equiv="refresh" content="20;url=http://www.wyxg.com">

  20  20     http://www.wyxg.com  

3.      js 

<script language="JavaScript">

function myrefresh()

{

       window.location.reload();

}

setTimeout('myrefresh()',1000); //  1     

</script>

JS         

//                

<script language=JavaScript>

   parent.location.reload();

</script>   

//        

<script language=JavaScript>

    self.opener.location.reload();

</script>

(   <a href="javascript:opener.location.reload()">  </a>   )

//                

<script language=JavaScript>

   parent.  FrameID.location.reload();

</script>

                    , <body>         。

<body onload="opener.location.reload()">      

<body onUnload="opener.location.reload()">      

<script language="javascript">

window.opener.document.location.reload()

               :

window.location.href=window.location.href ;

window.location.reload;

  window.location.href="      ", ie7     , ie6       , window.location.reload()   ,     

 

<js  >--javascript    

1.Response.Write("<script   language=javascript>parent.left.document.location.reload();</script>");
2.Response.Write("<script>window.top.location='login.aspx';window.close</script>"); 
3.this.RegisterStartupScript("reload","<script>window.parent.frames('left').location.reload(true);</script>");          this.RegisterStartupScript("reload","<script>window.parent.frames('left').location.href=window.parent.frames('left').location.href;</script>"); 

 

좋은 웹페이지 즐겨찾기