Several Methods for page Jump using JavaScript

Source: Internet
Author: User

First:

<Script language = "javascript">

Window. location. href = "index. php ";

// There are no commonly used methods to explain. You can directly specify the place to jump.

</Script>

Second:

<Script language = "javascript">

Alert ("return ");

Window. history. back (-1 );

// Similar to a button, if the parameter is a negative value, it will be regressed several times.

</Script>

Third:

<Script language = "javascript">

Window. navigate ("index. jsp ");

// The navigate object contains information about the browser. It can also be used as a page Jump, followed by a place to jump directly.

// The public standard is not applied to the navigator object, but all browsers support this object.

</Script>

Fourth:

<Script language = "JavaScript">

Self.location.href?index.htm;

// Self refers to the current window object, which belongs to the upper-level window object;

// Location. href indicates the URL address of a window object.

// Self. location. href indicates the URL address of the current window. Remove self as the URL address of the current window by default.

</Script>

Category 5:

<Script language = "javascript">

Alert ("illegal access! ");

Top. location = index. jsp;

// The top attribute returns the top-level parent window.

// This attribute returns the read-only reference of a top-level window.

// If the window itself is a top-level window, the top attribute stores references to the window itself.

// If the window is a framework, the top attribute references the top-level window containing the framework.

</Script>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.