Collection of methods for refreshing JavaScript web pages

Source: Internet
Author: User

How to refresh the page with javascript: CopyCode The Code is as follows: 1 history. Go (0)
2 location. Reload ()
3 location = Location
4 location. Assign (location)
5 document.exe ccommand ('refresh ')
6 window. navigate (location)
7 location. Replace (location)
8 Document. url = location. href

How to automatically refresh the page:
1. Automatically refresh the page: Add the following code to the Copy codeThe Code is as follows: <meta http-equiv = "refresh" content = "20">

20 indicates refreshing the page every 20 seconds.

2. automatic page Jump: Add the following code to the Copy codeThe Code is as follows: <meta http-equiv = "refresh" content = "20; url = http://www.jb51.net">

Where 20 refers to jump to the http://www.jb51.net page every 20 seconds

3. Automatically refresh JS version on the page Copy codeThe Code is as follows: <script language = "JavaScript">
Function myrefresh ()
{
Window. Location. Reload ();
}
SetTimeout ('myrefresh () ', 1000); // refresh once per second
</SCRIPT>

How does ASP. net output the script statement for refreshing the parent window?
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 (''page you want to refresh. asp''); </SCRIPT> ")

JS refresh framework script statement

Copy code The Code is as follows: // how to refresh the page containing the framework
<Script language = JavaScript>
Parent. Location. Reload ();
</SCRIPT>

// Refresh the parent window in the Child Window
<Script language = JavaScript>
Self. opener. Location. Reload ();
</SCRIPT>

(Or <a href = "javascript: opener. Location. Reload ()"> refresh </a>)Copy codeThe Code is as follows: // how to refresh the page of another framework
<Script language = JavaScript>
Parent. otherframeid. Location. Reload ();
</SCRIPT>

if you want to refresh the window when closing the window or refresh the window when opening the window, you can call the following statement in . copy Code the code is as follows: refresh when opening the window
refresh when disabled

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: info-contact@alibabacloud.com 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.