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

javascript force refresh page implementation code_javascript skills

WBOY
Release: 2016-05-16 18:39:22
Original
1138 people have browsed it

Several methods for Javascript to refresh the page:
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

Method to automatically refresh the page:
1. The page automatically refreshes: add the following code to the area

The 20 refers to refreshing every 20 seconds Page.

2. The page automatically jumps: add the following code to the area

The 20 fingers will jump to the http://www.jb51.net page after 20 seconds

3. The page automatically refreshes the 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>");
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 content The page of this frame uses


//The child window refreshes the parent window

( or )

//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 opening the window
Refresh when closing



//Jump out of the page
< ;SCRIPT LANGUAGE=JAVASCRIPT>