Home > Article > Web Front-end > Several js methods to implement page jumps
This article mainly shares with you several js methods to achieve page jumps, including button type, link type, and direct jump type. I hope it can help everyone.
Button type:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='http://blog.csdn.net/qq_25615395'">
Link type:
<a href="javascript:history.go(-1)">返回上一步</a><a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
Direct jump type:
<script>window.location.href='http://blog.csdn.net/qq_25615395';</script>
Open a new window:
<a href="javascript:" onClick="window.open ('http://blog.csdn.net/qq_25615395','','height=500,width=611,scrollbars=yes,status=yes')"& gt;布丁足迹</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("返回"); 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("非法访问!"); top.location='xx.jsp';</script>
=====The pop-up selection box in javascript jumps to other pages=====
<script language="javascript"> <!--function logout()...{if (confirm("你确定要注销身份吗?是-选择确定,否-选择取消"))...{ window.location.href="logout.asp?act=logout"} } --> </script>
=====The prompt box pops up in javascript to jump to other pages=====
<script language="javascript"> <!--function logout()...{ alert("你确定要注销身份吗?"); window.location.href="logout.asp?act=logout"} --> </script>
Related recommendations:
Various ways of page jump in PHP Method
What are the common methods for Javascript page jumps
The above is the detailed content of Several js methods to implement page jumps. For more information, please follow other related articles on the PHP Chinese website!