Home > Web Front-end > JS Tutorial > How to implement page jump in javascript

How to implement page jump in javascript

coldplay.xixi
Release: 2023-01-03 09:31:59
Original
11953 people have browsed it

Javascript method to implement page jump: 1. Open a new page on the current page by modifying the address link attribute [location.href] of the form object window; 2. You can call the [location.href] of the form object window open()] method implementation.

How to implement page jump in javascript

The operating environment of this tutorial: Windows 7 system, JavaScript version 1.8.5, DELL G3 computer.

How to implement page jump using javascript:

1. Open a new page on the current page

By modifying the address link attribute of the form object window location.href implements opening a new page in the current page, that is,

< language="java" type="text/java">
window.location.href="http://110.html";
</>
Copy after login

2. To implement opening a new page in a new window

can be achieved by calling the open() method of the form object window.

That is: window.open('http://hx110.com');

3. Jump back to the previous page

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

4. self: current Window object (if it is in an iframe, it is the window object of the frame)

< language="Java">
self.location=&#39;top.html&#39;;
</>
Copy after login

5. Pop-up prompt box jumps to other pages

< language="java">
<!--
function logout()...{
alert("你确定要注销身份吗?");
window.location.href="http://110.html"
}
Copy after login

Related free learning Recommended: javascript video tutorial

The above is the detailed content of How to implement page jump in javascript. 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