Common usage of location. href

Source: Internet
Author: User

Self. Location. href = "/url" the current page opens a new page, which is the same as the default location. href, windows. Location. href, or this. Location. href.

Parent. Location. href = "/url" opens a new page on the parent page.

Top. Location. href = "/url" opens a new page on the top page.

 

Top. Location. href = "/url"
It means opening the URL on the top-level page
Self. Location. href = "/url"
It is said that only the URL address opened on this page is
Parent. Location. href = "/url"
The URL address opened in your window

There should be another this. Location. href = "/url"
The usage is consistent with that of self.

In addition, if a custom frame exists in the page,
You can also change the parent self top to the custom frame name.
The effect is to open the URL address in the custom frame window.

If (window! = Top ){
Top. Location. href = "/login. aspx ";
}

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.