JavaScript Popup Using Window.Open

by top54u.com 10 Mar, 2008
Spotlight.....

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:

 

  • height: value in pixels. Min height value is 100

  • width: value in pixels. Min width value is 100

  • left: value in pixels. It sets the left edge of the popup windows away from the left side of screen.

  • top: value in pixels. Its sets the top edge of the popup away from the top of the screen.

  • fullscreen: value as yes, no, 0 or 1. To enable or disable the fullscreen mode of popup window.

  • status: value as yes, no, 0 or 1. To enable or disable the status bar.

  • titlebar:value as yes, no, 0 or 1. To enable or disable the title bar.

  • menubar: value as yes, no, 0 or 1. To enable or disable the menu bar.

  • resizable: value as yes, no, 0 or 1. To enable or disable the resizable property of the popup browser window.

  • scrollbars: value as yes, no, 0 or 1. To enable or disable the scrollbars for overflow.

  • toolbar: value as yes, no, 0 or 1. To enable or disable the tool bar.

  • location: value as yes, no, 0 or 1. To enable or disable the status bar address field of popup window.

 

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.

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

8/23/2008 9:00:06 PM

OUR SPONSORS[+ advertise here]
related videos.....
recent posts.....
top54u ezines.....