Home >Web Front-end >JS Tutorial >Several js methods to implement page jumps

Several js methods to implement page jumps

韦小宝
韦小宝Original
2018-03-14 18:39:072268browse


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=&#39;http://blog.csdn.net/qq_25615395&#39;">

Link type:

<a href="javascript:history.go(-1)">返回上一步</a><a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>

Direct jump type:

<script>window.location.href=&#39;http://blog.csdn.net/qq_25615395&#39;;</script>

Open a new window:

<a href="javascript:" onClick="window.open
(&#39;http://blog.csdn.net/qq_25615395&#39;,&#39;&#39;,&#39;height=500,width=611,scrollbars=yes,status=yes&#39;)"& 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=&#39;top.htm&#39;;</script>

The fifth type:

<script language="javascript">
          alert("非法访问!");
          top.location=&#39;xx.jsp&#39;;</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

Detailed summary of page jump

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn