Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post

    opening new window (NOT new tab)

    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??

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,388
    Thanks
    264
    Thanked 32 Times in 31 Posts
    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.

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

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    target="_blank" does not open a new window in tabbed browsers... it opens a new tab....

  • #4
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,388
    Thanks
    264
    Thanked 32 Times in 31 Posts
    ok so use window.open method and size your window. how about that?

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,994
    Thanks
    79
    Thanked 4,432 Times in 4,397 Posts
    Try forcing the *size* of the popup. If the size doesn't match the existing window it should pop up a separate window.
    Code:
    window.open( url, someName, "width=500, height=600" );
    HEH! Too slow. BTW, just tested it in FF and MSIE. Yep, worked.

  • #6
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    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

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,994
    Thanks
    79
    Thanked 4,432 Times in 4,397 Posts
    window.open is *NORMALLY* only blocked by popup blockers if the code is invoked automatically by the page. When you use something like
    Code:
    <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.

  • #8
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •