1. Javascript returns to the previous page
History. Go (-1), returns two pages: history. Go (-2 );
2. History. Back ().
3.
Window. History. Forward () returns the next page
4.
Window. History. Go (return the page number, or use the accessed URL)
Example:
<
Href = "javascript: history. Go (-1);"> to the previous page </a>
Response. Write ("<script
Language = JavaScript> ")
Response. Write ("If (! Confirm ('finish the task? ') {History. Back ();}")
Response. Write ("</SCRIPT> ")
Response. Write ("<script
Language = JavaScript> history. Go (-1); </SCRIPT> ")
<
Href = "javascript: history. Go (-1);"> to the previous page </a>
Page jump: onclick = "window. Location. href = 'list. aspx '"
P.s.
Tips (JS reference JS ):
<SCRIPT type = text/JavaScript>
<! --
If (typeof swfobject = "undefined "){
Document. Write ('<SCR' + 'iptype = "text/JavaScript"
Src = "/scripts/swfobject-1.5.js"> </scr'
+ 'Ipt> ');}
// -->
</SCRIPT>
How to refresh the page with javascript:
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
<Meta http-equiv = "refresh"
Content = "20">
20 indicates refreshing the page every 20 seconds.
2. automatic page Jump: Add the following code to the
<Meta http-equiv = "refresh" content = "20; url = http://www.wyxg.com">
20 means jump to the http://www.wyxg.com page every 20 seconds
3. Automatically refresh JS version on the page
<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
// 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 <
Href = "javascript: opener. Location. Reload ()"> refresh </a>
)
// How to refresh the page of another framework
<Script language = JavaScript>
Parent. Another frameid. 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 <body>.
<Body
Onload = "opener. Location. Reload ()"> refresh when opening the window
<Body
OnUnload = "opener. Location. Reload ()"> refresh when disabled
<Script language = "JavaScript">
Zookeeper opener.doc ument. Location. Reload ()
</SCRIPT>