1. Javascript returns to the previous page history.go(-1), and returns two pages: history.go(-2);
2. history.back().
3. window.history.forward() returns to the next page
4. window.history.go (return to the page, you can also use the visited URL)
example:
<a href=javascript:history.go(-1);>Previous page</a>
response.Write(<script language=javascript>)
response.Write(if(!confirm('Complete 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'
PS
Tips (JS quotes JS):
<script type=text/javascript>
<!--
if (typeof SWFObject == undefined) {
document.write('<scr' + 'ipt type=text/javascript src=/scripts/swfobject-1.5.js></scr' + 'ipt>');}
//-->
</script>
Several ways to refresh a page in 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. Automatic page refresh: add the following code to the <head> area
<meta http-equiv=refresh content=20>
20 of which refer to refreshing the page every 20 seconds.
2. Automatic page jump: add the following code to the <head> area
<meta http-equiv=refresh content=20;url=http://www.javaeye.com>
Among them, 20 fingers jump to the http://www.javaeye.com page after 20 seconds.
3. Automatic page refresh
<script language=JavaScript>
function myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',1000); //Specify refresh once in 1 second
</script>
How to output a 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(<script language=javascript>opener.window.navigate(''You want to refresh the page.asp'');</script>)
JS refresh framework script statement
//How to refresh the page containing the frame
<script language=JavaScript>
parent.location.reload();
</script>
//The child window refreshes the parent window
<script language=JavaScript>
self.opener.location.reload();
</script>
(or <a href=javascript:opener.location.reload()>Refresh</a> )
//How to refresh another frame's page
<script language=JavaScript>
parent.another FrameID.location.reload();
</script>
If you want to refresh when the window is closed or refresh when the window is opened, just call the following statement in <body>.
<body onload=opener.location.reload()> Refresh when opening the window
<body onUnload=opener.location.reload()> Refresh when closed
<script language=javascript>
window.opener.document.location.reload()
</script>