Copy Code code as follows:
<input Type=button value= Refresh onclick= "Window.location.reload ()" >
<input Type=button value= forward onclick= "Window.history.go (1)" >
<input Type=button value= back onclick= "Window.history.go ( -1)" >
<input Type=button value= forward onclick= "Window.history.forward ()" >
<input Type=button value= back onclick= "Window.history.back ()" > Back + refresh <input Type=button back value= " Window.history.go ( -1); Window.location.reload () ">
In a C # Web program, such as returning the previous page of code for a page button write
Copy Code code as follows:
This. RegisterClientScriptBlock ("E", "<script language=javascript>history.go ( -2);</script>");
Where, History.go (-2) is written as-2, the page is refreshed once before the button event is triggered, so it should be-2.
Copy Code code as follows:
Response.Write ("<script language=javascript>history.go ( -2);</script>");
This is also written as "-2". differs from direct write scripts. History.back () is the previous page
Copy Code code as follows:
I=1
History.go (i)
[HTML]
Go to the specified page
If it is history.go (0) that is refreshing these two belong to JS code, the equivalent of IE forward, back function.
The specific use depends on when you need it. For example, when the user registration verification is the background verification, does not meet the requirements of the time can use this, can maximize the user to ensure that less repeated input data.
For example: Load page:
[Code]
function Onloadpage () {
if (event.srcelement.tagname== "SPAN") {
OFRAME=TOP.WINDOW.MIDDLE.FRAMES[2];
Otxt=event.srcelement.innertext;
Switch (otxt) {
Case "forward":
OFrame.history.go (1);
Case "Back":
OFrame.history.back ();
Case "Refresh":
OFrame.location.reload ();
}
}
}
To open a JSP page, it must be refreshed with client script.
JavaScript refreshes the page in several ways:
Copy Code code as follows:
1 history.go (0)
2 location.reload ()
3 location=location
4 lo Cation.assign (location)
5 document.execcommand (' Refresh ')
6 window.navigate (location)
7 Location.replace (location)
8 document. Url=location.href