1. Javascript returns the previous page history. go (-1), and 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:
<A href = "javascript: history. go (-1);"> 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> ")
<A href = "javascript: history. go (-1);"> 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 <a 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 a window
<Body onUnload = "opener. location. reload ()"> refresh when disabled
<Script language = "javascript">
Zookeeper opener.doc ument. location. reload ()
</Script>
From the wolinxuebin Column