View Full Version : opening new window (NOT new tab)

07-13-2011, 03:38 AM
is there a way in HTML or Javascript to open a new window and force it to be a new Window, not a new tab? and also avoid popup blockers??

07-13-2011, 04:55 AM
this will open in a brand new window. as far as avoiding pop up blockers the best i have seen is to send a message to the user that they are blocking popups. maybe someone else knows a trick on that one.

<a href="your url" target="_blank">click here</a>

07-13-2011, 04:56 AM
target="_blank" does not open a new window in tabbed browsers... it opens a new tab....

07-13-2011, 04:58 AM
ok so use window.open method and size your window. how about that?

Old Pedant
07-13-2011, 05:03 AM
Try forcing the *size* of the popup. If the size doesn't match the existing window it should pop up a separate window.

window.open( url, someName, "width=500, height=600" );

HEH! Too slow. BTW, just tested it in FF and MSIE. Yep, worked.

07-13-2011, 05:09 AM
i tried both of those. the window.open one is blocked by popup blockers, and the resizing of _blank just resizes the entire window, tabs and all... which is not what i want :S

Old Pedant
07-13-2011, 05:20 AM
window.open is *NORMALLY* only blocked by popup blockers if the code is invoked automatically by the page. When you use something like

<a href="#" onclick="window.open(url,'foo','width=600,height=600');return false;">click</a>

it will only be blocked by the most agressive blockers. But there's no way around those. Normal blockers will allow it.

07-13-2011, 05:21 AM
ok i guess ill use that. it does seem to work on some browsers ive tested. the rest i guess ill just give an Alert for the user to hold CTRL key and click again, thanks