<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 value= back onclick=" 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
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.
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
I=1
History.go (i) to a 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:
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:
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
The above is small series for everyone to bring back and refresh the JavaScript in the full content of the implementation method, I hope that we support cloud-Habitat Community ~