Javascript: open new window with window.open()

Advertisement ∇

What is window.open() in javascript?
window.open() is the javascript function tat use to open new window. Many advertiser use use this javascript window.open() function to pop up or open new window (or even pop under) for their advertisement.

How to use window.open() function?
To open a new window in javascript, simply follow the script below:-

window.open (”http://www.sillycorner.com”,”windowName”);

Below is the javascript window.open function details:-

window.open (url,windowname,attributes);


How to adjust the new window width, height and other element?
Just pass in the attributes (string without space) as the third arguement in the window.open() function.

window.open (”http://www.sillycorner.com”, “windowName”, “width=300,height=150,status=yes,location=no”);

The code above will open a new window width 300px, height 150px with status bar and no location bar, pointing to http://www.sillycorner.com.

Below are the attribute variables:-

height - int - height of the window in pixels. (example: height=300)
width - int - width of the window in pixels.
resizable - yes/no - Allow or disallow user to resize the window.
status - yes/no - The status bar at the bottom of the window
menubar - yes/no - The menu bar of the window
toolbar - yes/no - The standard browser toolbar with Back button.
location - yes/no - The URL bar.
scrollbars - yes/no - Hide or show the scrollbars

Technorati Tags: , , , , , , , , ,

Do you use the computer for your business or office? If you spend most of your day on the computer, make sure you are getting the best in cheap computer software!  Do you work in video editing? If you need the best in cheap video editing software, the internet is your best choice!

Share and Enjoy:
  • Reddit
  • BlinkList
  • del.icio.us
  • Digg
  • Fark
  • IndianPad
  • StumbleUpon
  • YahooMyWeb
Posted at October 9th, 2006 by chua

If you think this article helps you to solve your problem and clear your headache, feel free to buy me a drink :)

Related Post

One Response to “Javascript: open new window with window.open()”

  1. Alex Says:

    Thank You

Leave a Reply