Home > Web Front-end > JS Tutorial > body text

js code summary for refreshing the page recommended_javascript skills

WBOY
Release: 2016-05-16 18:30:40
Original
1036 people have browsed it

1. Javascript returns to the previous page history.go(-1), returns two pages: history.go(-2);
2. history.back().
3. window.history.forward( )Return to the next page
4. window.history.go (return to which page, you can also use the visited URL)
Example:
Previous page
response.Write("")
response.Write("
Several ways to refresh the page using Javascript:

Copy the 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

Methods to automatically refresh the page:
1. Automatically refresh the page: Add the following code to the area

20 means refreshing the page every 20 seconds.
2. Automatically jump the page: add the following code to the area

The 20 fingers will jump to the http://www.wyxg.com page after 20 seconds
3. The page refreshes automatically js version
Copy code The code is as follows:



How ASP.NET outputs the refresh parent window script statement
1. this.response.write("<script>opener.location.reload();< /script>"); <br>2. this.response.write("<script>opener.window.location.href = opener.window.location.href;</script>");
3 . Response.Write("")

JS refresh frame script Statement
//How to refresh the page containing the frame using

//Subwindow Refresh the parent window

( or Refresh )
//How to refresh the page of another frame using

If you want to refresh when the window is closed or you want to refresh when the window is opened, just call the following statement in .
Refresh when the window is open
Refresh when the window is closed
< script language="javascript">
window.opener.document.location.reload()
Related labels:
js
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