Window.Open method can be used to open new browser windows or you can say javascript popup windows. Using open method you can open new browser window by passing any URL or null. If you will not pass any URL to open method then it will open about:blank page in the popup window.
Syntax: window.open(‘URL’, ‘name’, ‘features’, ‘replace’);
URL: pass the URL of other site or personal web page.
Name: Set the name for popup window. Do not use spaces in the name parameter of window.open method.
Features: It accepts the comma-separated list of features with their values. These features are used to adjust the popup position on the screen, height, width, full screen mode, resizing and scrolling etc. Following are some the commonly used features:
Replace: accepts the value as true or false. If you will pass true then it will replace the document url in the browser history and if you will pass false then it will not replace the url from the history list.
Examples of JavaScript Popup using window.open:
window.open('http://programming.top54u.com');
Above code will open the passed url in the new popup window.
window.open('','MyWindow','scrollbars=no, resizable=no, height=200px, width=300px, titlebar=yes',true)
Above code will open the blank popup window with specified features.
You can pass the url or personal web page link as first parameter to open in the popup browser window.
Be the first to rate this post
Tags: javascript, javascript popup, javascript window, javascript window.open, javascript use, javascript tutorials, learn javascript, javascript examples
8/23/2008 9:00:06 PM