Home > Web Front-end > JS Tutorial > body text

Several js methods to implement page jumps

韦小宝
Release: 2018-03-14 18:39:07
Original
2226 people have browsed it


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;">
Copy after login

Link type:

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

Direct jump type:

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

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>
Copy after login

The first type:

<script language="javascript" type="text/javascript">
           window.location.href="login.jsp?backurl="+window.location.href; 
</script>
Copy after login

The second type:

<script language="javascript">
    alert("返回");
    window.history.back(-1);</script>
Copy after login

The third type:

<script language="javascript">
    window.navigate("top.jsp");</script>
Copy after login

The fourth type:

<script language="JavaScript">
          self.location=&#39;top.htm&#39;;</script>
Copy after login

The fifth type:

<script language="javascript">
          alert("非法访问!");
          top.location=&#39;xx.jsp&#39;;</script>
Copy after login

=====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>
Copy after login

=====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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!