SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: target="_blank"

  1. #1
    SitePoint Addict
    Join Date
    Jun 2009
    Location
    Norfolk - UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    target="_blank"

    Soon after learning html I read an article saying that target="_blank" was depreciated...that was some years ago now.

    What are we supposed to use instead? Or is it OK to continue using this code?

    Thanks, Karl.

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    Its a pretty inflammatory topic at the minute and you might want to get a cup of tea and read this thread: http://www.sitepoint.com/forums/showthread.php?t=703917
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Addict
    Join Date
    Jun 2009
    Location
    Norfolk - UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Its a pretty inflammatory topic at the minute and you might want to get a cup of tea and read this thread: http://www.sitepoint.com/forums/showthread.php?t=703917
    Thanks for the link Spike!

    It has bothered me using target="_blank" because of the sheer amount of windows the user may end-up with. The idea that the user will not lose your original site pales by the fact that though the site is not lost it maybe just too much trouble to find it with all the new windows opened. I know that I have quit my browser in frustration many a time because of that.

    However, the target="_name" suites me fine! I never knew about it and although many may not agree with it, I think it'll serve me well...Hmm...one thing though, I just thought...as I'm moving over to html5 I will have to check it will still work with it.

    Thanks again Spike, appreciated. Karlos

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Top and bottom; it isn't deprecated in HTML 4.01 and never has been either. Though has a long history of being misused for such necromancy as facilitating popup windows when it should only be used for 'framed environments'.

    It doesn't appear in Strict DTD because of the issues covered in the other linked thread.

  5. #5
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,882
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by karlos1001 View Post
    Soon after learning html I read an article saying that target="_blank" was depreciated...that was some years ago now.

    What are we supposed to use instead? Or is it OK to continue using this code?
    What you should be doing is allowing surfers to control their own browsing habits rather than forcing things onto them - ie, don't make links open in new windows by any means, whether it's target="_blank" or Javascript.

    Right-click + "Open in new window/tab" (or alternative methods) is pretty well known and well understood. Particularly now that tabbed browsers are the norm, and given that not all of them treat 'new window' links in the way the user wants (eg, often open a new window rather than a new tab), forcing people to open a new window whether they want to or not is downright rude. Sure, as an Opera user, I can force a link to open in the current window/tab, but the 99% of surfers who are not sufficiently enlightened as to use Opera don't have that luxury, they are stuck with the choice you have made for them, rather than being able to make their own choice.

    The back button is very well known and well understood. If people want to go back to the last site or page they were looking at, they can do that by using the back button. Opening a link in a new context breaks this basic functionality, and can confuse and disorientate people (particularly less experienced surfers) when they find multiple windows open and back buttons not working properly.

    Not to mention the vast array of pop-up blockers out there, some of which will block all links that open in a new window or new tab, so people using those will never get to see the link at all.

    There are a few occasions when it's appropriate to open a link in a new window, but you need a very good reason to do so. "So that my site is still open so that they can come back to it later" is not even a good reason, let alone a very good one! Let people take control of their browsing, and you'll end up with much more satisfied customers then if you're forever forcing them into routes they don't want to take.

  6. #6
    SitePoint Addict
    Join Date
    Jun 2009
    Location
    Norfolk - UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not to mention the vast array of pop-up blockers out there, some of which will block all links that open in a new window or new tab, so people using those will never get to see the link at all.
    Thats a good point and something I'd not considered...I wonder what percentage of users would be blocked from my links of I used target="_name" ?

    I have to say, I still like the concept of target="_name"...only opening one page seems great...but if it's blocked!

    Karl.

  7. #7
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,882
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by karlos1001 View Post
    Thats a good point and something I'd not considered...I wonder what percentage of users would be blocked from my links of I used target="_name" ?

    I have to say, I still like the concept of target="_name"...only opening one page seems great...but if it's blocked!
    (You don't need the _ there, the reserved target names are _blank, _top, _self and _parent, but any ones that you make up are fine without the underscore).

    That's equally dangerous though. Leaving aside the point about it being just plain rude, let's say someone is on your site and clicks on a link, which opens up in a new window called by target="karlosnewwindow", because you've been careful to ensure there's no clash with anyone else's target names. Then they want to go to another link, so they switch back to your website, click a link ... and nothing happens. Or at least, that's what it looks like to them. What's actually happened is that the page has loaded into the window they've already opened, but because it's now behind the window with your site in - and most browsers won't bring it to the front - the user isn't aware that the page has loaded in a background window (why on earth would anyone expect that?), so assumes that nothing has happened when he clicked on the link => One unhappy customer who thinks your site is broken.

  8. #8
    SitePoint Addict
    Join Date
    Jun 2009
    Location
    Norfolk - UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by Stevie D View Post
    Then they want to go to another link, so they switch back to your website, click a link.....One unhappy customer who thinks your site is broken.
    Doh! Stevie D... you're breaking my heart! I thought I'd got it all sorted with this target="_name" thingy, still I see your point.

    I'm certainly going to have to think long and hard about this issue...I'm not exactly sure what'll happen next time I have to put an external link on one of my sites, I might just break out in floods of tears because of the pressure of it all!

    The natural thought is...once you've got someone on your site...don't let them go whatever you do!! But I can see that maybe somewhat problematic, Hmm...

    A[ppreciated, Karl.

  9. #9
    Error 404: Life not found silver trophybronze trophy
    Join Date
    Dec 2007
    Location
    UK Nr Manchester
    Posts
    3,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    What you should be doing is allowing surfers to control their own browsing habits rather than forcing things onto them -
    In your opinion.

    I'll stick to providing my visitors with what seems like a good experience whilst deliberately influencing both the way they browse my sites and the decisions they make, as a result of the way my sites structure and content is carefully designed to force them to do things without them even realising it.

    I don't use _target or _blank but I would if it suited my purposes and I disagree strongly with this oversensitive attitude that the visitor should never be forced to do anything, rubbish, it happens to you every single time you land on any website ever. You just don't notice most of the time, especially if it's done well.
    It's 530 people, but do you really get it?
    ImgWebDesign - Web design in Buxton, High Peak, Derbyshire UK.

  10. #10
    SitePoint Zealot
    Join Date
    Aug 2009
    Location
    Bavaria, Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do not like the "target'_blank'" thing but our users are (normally) no technicians and mostly don't know about right-click behaviours or something like that... I do persuade my colleagues and chefs every week to web standards and stuff but I do not have arguments for opening an external page in the same window... our (average) user does not know what he can do.
    Never argue with an idiot
    they drag you down to their level
    and then beat you with experience

  11. #11
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    From the other thread SpikeZ linked to:
    Thanks everyone. Interesting that links from this site open in a new window.
    I wonder if this is because of login issues? Going forward to some other domain and then hitting the back button... could that cause problems for some logged in members?

    I do persuade my colleagues and chefs every week to web standards and stuff but I do not have arguments for opening an external page in the same window... our (average) user does not know what he can do.
    I know at one time the average user expected links to create a new window, because so many sites just did that. It seems the tide has turned and more sites just move the current window forward than open new windows.

    I'd argue against the "our (average) user does not know what he can do" with regards to the back button. Old research (complimenting newer research) shows that's the #2 place everyone seems to know to use (#1 is clicking hyperlinks on the page). For the rest, it's arguable (text resizing, script blocking, etc) that most users don't know what they can do. But new windows, I avoid.

  12. #12
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Well well... usability research.

    http://webaim.org/discussion/mail_message?id=16440

    Links to "this" site open in the same tab; links to "other" sites open in a new tab. The programmers were convinced that all our users would regard this behavior as a feature -- because the original site would always remain open, they would be able to go back to it easily.
    ...
    I should mention that none of the study participants had any noticeable form of disability.
    ...
    - None of our participants immediately recognized when a new tab had opened. They all expected their browser's "Back" button to return them to the previous view.
    - Most participants became disoriented when the "Back" button failed to work -- even participants who themselves had been opening other sites in new tabs...
    - Only one participant quickly figured out that a new tab had opened on him. He tried the "Back" button twice before realizing that, if it was broken, he must be in a new tab.
    - Several participants eventually realized what had happened and started closing tabs to get back to the application -- and wound up closing the application by mistake.
    - A few participants, including some with quite a bit of experience with the Web, hit the frustration point without figuring out what had happened. (We told them and got them reoriented to continue the test.)


Bookmarks

Posting Permissions

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