How to use window.open() function?
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
I totally agree with Gabriel…. why are you forcing people to look elsewhere when all you have to do is put a sample of the working code along with your article. Jeez!
Sigh… this is somewhat useful, but it’s always best to put in a verbatim example. Many newbies are not going to have any idea of what to do with the code listed. Does it go in an anchor tag? Should it be in within a script tag? It’s just a wasted opportunity if you put some of the details up and don’t show EXACTLY how it’s used.