When building a website, you will inevitably encounter the problem of page redirection. Is the new page opened on the current page? Or open in a new window? Do you need to jump according to the parameters or you need to pass the user's confirmation before jumping? In many cases, let’s take a look at some commonly used examples of JS page jumping.
Button style:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='http://www.ddhbb.com/'">
Linked:
<a href="javascript:history.go(-1)">Return to previous step</a> <a href="<%=Request.ServerVariables("HTTP_REFERER")%>">Return to previous step</a>Direct jump:
<script>window.location.href='http://www.ddhbb.com';</script>
Open a new window:
<a href="javascript:" onClick="window.open('http://www.ddhbb.com/blog /guestbook.asp','','height=500,width=611,scrollbars=yes,status=yes')"& gt;Pudding Footprint</a>The first type:
<script language="javascript" type="text/javascript"> window.location.href="login.jsp?backurl="+window.location.href; </script>
The second type:
<script language="javascript">alert("return");window.history.back(-1); </script>The third type:
<script language="javascript">window.navigate("top.jsp"); </script>The fourth type:
<script language="JavaScript"> self.location='top.htm'; </script>
The fifth type:
<script language="javascript"> alert("illegal access!"); top.location='xx.jsp'; </script>====================================================================================�
<script language="javascript"><!--function logout()...{if (confirm("Are you sure you want to log out of your identity? Yes-select OK, No-select Cancel"))...{window.location.href="logout.asp?act=logout"}}--></script>======== The prompt box pops up in javascript and jumps to other pages======<script language="javascript"><!--function logout()...{alert("Are you sure you want to log out of your identity?");window.location.href="logout.asp?act=logout"}--></script>The above content is a summary of JavaScript's page jumping methods introduced to you by the editor. I hope it will be helpful to you, and I hope you will pay more attention to the Wulin.com website!