Open a new page

Source: Internet
Author: User

1.window.open (URL,NAME,SPECS);

URL: Opens the URL of the page without specifying a URL to open a new blank window

Name:_blank New window opens, default

_self Current Page Open

Name window ...

Specs: A comma-separated list of items. The following values are supported: the height of the Height=pixels window, the minimum value is the width of the Width=pixels window, the minimum value is Left=pixels top=pixels ...

Example window.open (', ', ', ' width=200,height=200 ');

<ButtonID= "BTN">New Page</Button>    <Script>        varbtn=document.getElementById ('btn'); Btn.onclick=function() {window.open ('child.html',"','width=200,height=200'); }    </Script>

2.location object contains URL information about the current page

HREF Sets or returns the full URL. ......

location.href= ' children.html ';

3.

Location.assign (' children.html ');

4.

Location.replace (' children.html ');

Attention

The first way to open a new page if it is _self this page opens, you can also return

2, 3 ways to open a page can be returned

The fourth method opens the new page, is directly replaces the original page, cannot return;

Open a new page

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.