Open New Window Code Generator

There are many times when you want to open a new window from one of your web pages and control the size and appearance of that window.

The open new window code generator below will provide you with the JavaScript you need to create a button to open your new window, looking the way you want it to!


Create the JavaScript Code for the new window you want to open:
Step 1 : Enter the name of the file you want to open and the size of the window you want it to open in.
URL:   (File name or web address)
Window Name: Width: Height: 
 Step 2: Check what you want your new window to offer:
URL Location Menubar
Scrollbars Status Bar
Toolbar Resizable Window
Step 3: Check a sample of your new window:

Step 4: Enter the text for the button that opens the window:
Button text:  
Step 5: Generate the code for your open new window button:

You can now paste the JavaScript code into your web page's code at the place where you want your button to appear.

With your button code in position all you need to do is click it, and you will open a new window!

TIPS! You only need to change the Window Name if you plan to have more than one window-opening button on a page. If you more than one button to open different files in the same window, then use the same Window Name for each of the buttons. If you want the files to open in different windows, then give a new Window Name for each button you create.

You may want to have a Close Window button in the window you open - just as there is in the window-sample.html you can access through this page's generator. Here is the JavaScript code for a close window button:




Return to Top