Summary of several ways to refresh a page

Source: Internet
Author: User

  This article is a detailed summary of several ways to refresh the page, including JS and Need friends can come to the reference, I hope to help you.

JavaScript refreshes the page in several ways:    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    Automatically refresh the page:    1. Page Auto Refresh: Add the following code to <head> area   <meta http-equiv= " Refresh "content=" >  20 means to refresh the page every 20 seconds.   2. Page Auto Jump: Add the following code to <head> area     <meta http-equiv= "Refresh" content= 20;url=http://">  20 fingers 20 seconds to jump to     3. Page automatically refresh JS version   < Script language= "JavaScript" >      function Myrefresh ()       {      &NBSP ;    window.location.reload ();     }      settimeout (' Myrefresh () ', 1000); Specify 1 seconds to refresh once   </script>      ASP. NET how to output refresh the parent window script statement     1. This.response.write ("<script>opener.location.reload ();</script>");      2. This.response.write ("<script>opener.window.location.href = opener.window.location.href;</script>");   3. Response.Write ("<script language=javascript>opener.window.navigate (" You want to refresh the page. asp ');</script> ");     JS Refresh Framework Script statement  //How to refresh the page containing the framework with     <script language=javascript>      Parent.location.reload ();  </script>        //child Windows Refresh parent window   <script language= javascript>      self.opener.location.reload ();  </script>  (or <a href= " Javascript:opener.location.reload () "> Refresh </a>  "      //How to refresh the page of another frame with     < Script language=javascript>     parent. Another FrameID.location.reload ();  </script>    If you want to close the window or refresh when you want to open windows, call the following statement in <body>.   <body onload= "opener.location.reload ()" > Refresh when opening windows   <body onunload= "Opener.location.reload ()" > Close window Refresh   <script language= "JavaScript" >      Window.opener.document.location.reload ()   </script>    

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.