Javascript window.open method / Open PopUp window

Do you want to open PopUp window from your current window. It can open by using javascript’s window.open method. The new opened window is called the Child window and from which window you have open it is called Parent window.

The syntax of window.open is as follows:

open (URL, windowName[, windowFeatures])

Where URL is the url of the page which you want to open.
windowname is a name given to the new window
windowFeatures is the string which can include status bar, address bar etc.. window features will be included in the new popup window.

For example:
window.open (“https://vijaymodi.wordpress.com”,”Vijay Modi’s Blog”);

will opens a new browser window with standard features.

To open a window with statusbar and toolbar you have to write the following code:

window.open (“https://vijaymodi.wordpress.com”,”Vijay Modi’s Blog”,”status=1,toolbar=1″);

The following table shows the features and the string tokens you can use in the features depends on your requirements:

status The status bar at the bottom of the window.
toolbar The standard browser toolbar, with buttons such as Back and Forward.
location The Location entry field where you enter the URL.
menubar The menu bar of the window
directories The standard browser directory buttons, such as What’s New and What’s Cool
resizable Allow/Disallow the user to resize the window.
scrollbars Enable the scrollbars if the document is bigger than the window
height Specifies the height of the window in pixels. (example: height=’350′)
width Specifies the width of the window in pixels.

Regards,
Vijay Modi

Advertisements

About Vijay Modi

Having 12+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

3 Responses to Javascript window.open method / Open PopUp window

  1. James says:

    What is the diffrent between onclick and onclientclick()

  2. Vijay Modi says:

    In ASP.Net web application we can check the value by using onClientClick and for executing the code on server side we use onClick. To understand in detail please go to the following link:

    https://vijaymodi.wordpress.com/2007/06/08/button-onclick-and-onclientclick-2/

    Thanks for your comments,
    Vijay Modi

  3. Pingback: hosthg » Blog Archive » Javascript window.open method

  4. Valrie says:

    Vjay, how do I add this window statement to a php page.
    Here is my code, I want the mso1.php and display2.php to be displayed with a menubar and a scrollbar.

    Can you advise?

    Much thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s