window.open implement navigation and open windows, navigate to a specific link address, or open a new browser form

Source: Internet
Author: User

Grammar

window.open (strURL, strWindowName , strWindowFeatures , replace)
strURL: Open the address of the resource
strWindowName: Represents the form name. If the parameter specifies a window that already exists, the open () method no longer creates a new window, and only returns a reference to the specified window. In such cases fratures will be ignored.
strWindowFeatures

Replace: An optional Boolean value. Specifies whether the URL loaded into the window creates a new entry in the window's browsing history or replaces the current entry in the browsing history. The following values are supported:
  
True-url replaces the current entry in the browsing history.

False-url creates a new entry in the browsing history.

Instance one: Open the develop link
1 window.open ("http://www.baidu.com");

Example two: Open a new form

    mywindow=window.open (', ', ', ' width= 200,height=100 ')    myWindow.document.write ("This is ' Mywindow '")    mywindow.focus ()</ Script></body>

Attention:

<1> if a window with a name already exists strWindowName , no longer opens a new window, but strUrl loads it into this window. In this case, the return value of the method is the window that has been opened and the parameter is ignored strWindowFeatures . When strURL is set to an empty string, you can obtain a reference to a window that already has an open name without changing the address of the window. If you want to window.open() open a new window each time you call, set the parameter to strWindowName _blank .

  <2>  strWindowFeaturesis an optional string that contains a comma-delimited set of new windows that cannot be used to change the window's functionality or toolbar settings after the window is opened. If the name is a strWindowName window that does not exist and does not provide a strWindowFeatures parameter (or if the strWindowFeatures argument is an empty string), the child window is rendered as the default toolbar of the parent window.

If the strWindowFeatures window size is not defined in the parameter, the size of the new window is the same as the size of the recently rendered window.

If the strWindowFeatures window position is not defined in the parameter, the new window displays the coordinates of the recently rendered window at a position of 22 pixels. This new window offset approach is widely implemented by browser developers (MSIE 6 SP2 is offset by 29 pixels under the default theme) to alert the user that there is a new window open. If the most recently used window is maximized, the new (child) window is maximized without the 22-pixel offset.

  

Strwindowfeatures Parameters:

  

Channelmode=yes|no|1|0 Whether to use the theater Mode Display window. The default is No.
Directories=yes|no|1|0 Whether to add a catalog button. The default is yes.
Fullscreen=yes|no|1|0 Whether to use full-screen mode to display the browser. The default is No. A window in full-screen mode must be in theater mode at the same time.
Height=pixels The height of the window document display area. measured in pixels.
Left=pixels The x-coordinate of the window. measured in pixels.
Location=yes|no|1|0 Whether the Address field is displayed. The default is yes.
Menubar=yes|no|1|0 Whether the menu bar is displayed. The default is yes.
Resizable=yes|no|1|0 Whether the window can be adjusted for size. The default is yes.
Scrollbars=yes|no|1|0 Whether scroll bars are displayed. The default is yes.
Status=yes|no|1|0 Whether to add a status bar. The default is yes.
Titlebar=yes|no|1|0 Whether the title bar is displayed. The default is yes.
Toolbar=yes|no|1|0 Whether to display the browser's toolbar. The default is yes.
Top=pixels The y-coordinate of the window.
Width=pixels The width of the document display area of the window. measured in pixels.

Parameters correspond to the form:

window.open implement navigation and open windows, navigate to a specific link address, or open a new browser form

Related Article

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.