Net-informations.com
SiteMap  | About    

Window open() Method

You can use JavaScript to launch a new window. The window.open() method, which allows you to open up new browser window without navigating away from the current page. It is useful when you need to display some popup advertisement or the instructions without navigating away from the current window. To open a new browser window, use the window.open() method.

Syntax



Source

In the above code, the return value , stored in the variable newWindow, is the reference to your new window. You can use this reference later, for example, to close this window (newWindow.close()), give focus to the window (newWindow.focus()) or perform other window manipulations.

The important Parameter of window.open() method are url, name, left, top, height and width. The other parameters are toolbar, menubar, scrollbars and resizable.



Source

Normally only the first three arguments are used to open a new popup window in Javascript. It is important to note that the new window will not open if the user disabled the JavaScript in the browser, because various browser policies and user settings may prevent you from opening a popup window. Moreover now a days most browsers have a built in pop-up blocking software for blocking to abuse of the technique for marketing purposes.

Such types of Popup windows were overused and exploited by many websites during the earlier days of the web. This resulted in the later versions of browsers blocking popup windows . Eventually, popup windows became almost extinct now. Automatically opening popup windows is considered a very bad practice nowadays.









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.