Home > Web Front-end > JS Tutorial > javascript web page refresh method collection_javascript skills

javascript web page refresh method collection_javascript skills

WBOY
Release: 2016-05-16 18:50:44
Original
1908 people have browsed it

Several ways to refresh the page using Javascript:

Copy code The code is as follows:

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


How to automatically refresh the page:
1. Page automatically Refresh : Add the following code to the area
Copy the code The code is as follows:



The 20 refers to refreshing the page every 20 seconds.

2 .Automatic page jump: Add the following code to the area
Copy the code The code is as follows:



20 means 20 Jump to http://www.jb51.net page in seconds

3. The page automatically refreshes js version
Copy Code The code is as follows:




ASP How does .NET output the refresh 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("")


JS refresh frame script statement

Copy code The code is as follows:

//How to refresh the page containing the frame with
< ;script language=JavaScript>
parent.location.reload();


//The child window refreshes the parent window


( or Refresh< ;/a> )
Copy code The code is as follows:

//How to refresh another frame If you want to close the window, use



If you want to refresh when the window is opened or want to refresh when the window is opened, just call the following statement in .
Copy code The code is as follows:

Refresh when the window is open
Refresh when the window is closed

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template