Page 1 of 1

[SOLV]Javascript: window.open creating a new tab not window.

Posted: Mon Mar 19, 2007 5:30 pm
by impulse()
In the past I've used the window.open Javascript function to open a new window in Firefox but now it's only opening a new tab in Firefox. This is the line of code I'm using:

Code: Select all

<input type = 'submit' onClick = "window.open('www.google.com', 'height = 100, width = 200');">
I have tried this line of code in IE and that reports errors on the page but doesn't explain why. Firefoxs' error console doesn't report any errors while using the button.

Can anybody see what is causing this?

Regards,

Posted: Mon Mar 19, 2007 5:53 pm
by Luke
the window opening in a tab instead of a new window is a setting in firefox. this is something only the use has controller over.

Posted: Thu May 10, 2007 4:37 pm
by impulse()
Many days later I find out this was because I hadn't named the window.

Code: Select all

<input type = 'submit' onClick = "window.open('www.google.com', 'height = 100, width = 200');">
should be

Code: Select all

<input type = 'submit' onClick = "window.open('www.google.com', '<nameOfWindowHere>', 'height = 100, width = 200');">