The examples in this article describe the commonly used return, automatic jump, refresh, and close statements in JavaScript. Share it with everyone for your reference. The details are as follows:
1. Javascript Return to the previous page:
history.go(-1)
Return to two pages:
history.go(-2)
2. Back:
history.back()
3. Return to the next page:
window.history.forward()
4. To return to the page, you can also use the visited URL:
window.history.go(return to location)
Example:
Page jump:
onclick="window.location.href='list.aspx' "
P.S.
Tips (JS citing JS):
Several ways to refresh the page using Javascript:
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. The page automatically refreshes: add the following code to the
area
Among them, 20 refers to refreshing the page every 20 seconds.
2. Automatic page jump: add the following code to the area
Among them, 20 fingers will jump to
http://www.jb51.net page
after 20 seconds.
3. The page automatically refreshes the js version
How does ASP.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
//How to refresh the page containing the frame with
Child window refreshes parent window: