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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Adirondacks
    Posts
    516
    Thanks
    4
    Thanked 4 Times in 4 Posts

    link to open in new tab?

    I don't followup so well on what the W3C recommends or what FF and IE now allow as far as coding.
    Is there a way (like "target" for a new window) to open up a link in a new tab yet?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,706
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    That’s at the sole discretion of the user how she wants to open new pages and can only really be set in the browser preferences. You can use JavaScript window.open to replace target="_blank" but that’s as far as you can go. Whether this script opens a new window or a new tab is at the user’s discretion. You can’t influence the rest and the W3C doesn’t recommend anything in this direction. In fact, they kinda do recommend to leave it to the user as well (by having removed the target attribute from the official HTML specification).

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    VIPStepan already give the answer.

    I use this code as replacement for target attribute:
    Code:
    <a href="url" onclick="window.open('url'); return false;">...
    work with js enabled but if is disabled work like a normal link.

    regards

  • #4
    New Coder
    Join Date
    Dec 2006
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Not all browsers implement tabbed browsing. The idea is for the users to be able to decide for themselves. You can open a new window with target="_blank", although that will not be XHTML Strict compliant. For that, you would have to do it using JavaScript.

  • #5
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by VIPStephan View Post
    You can’t influence the rest and the W3C doesn’t recommend anything in this direction. In fact, they kinda do recommend to leave it to the user as well (by having removed the target attribute from the official HTML specification).
    However, it's not completely off the table…

    http://www.w3.org/TR/css3-hyperlinks/#target-new

  • Users who have thanked Bill Posters for this post:

    oesxyl (06-23-2008)

  • #6
    New Coder
    Join Date
    Dec 2006
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    is there a way to open one link into more then one tab? like say I want to open codingforums.com in 10 different tabs on one click?


  •  

    Posting Permissions

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