Support » Fixing WordPress » Odd thing with “target=_blank”

  • I prefer to set links to open in a new window; otherwise, people are taken away from my site and might not find their way back. I have always used the “target=_blank” tag, placed last in the code designating the link, but now find that Ecto puts it in the wrong place, so it doesn’t work. I try to edit the HTML in my WordPress window, by moving the tag to last in the link designation string, but when I save the new HTML code, the tag has been moved back to its original location. I need some help, please.

    Confused in Baltimore

Viewing 9 replies - 1 through 9 (of 9 total)
  • Works fine here, using Opera.

    Wow, how strange…I think I’ve found a quirk of Firefox. Based on your observation, Zoutesnor, I viewed my site in Safari and the tag works just fine. My knowledge of HTML, obviously, is limited, and I thought the problem related to where the “target” tag was placed in the code for the link. Now, I suspect, the problem is Firefox doesn’t respond to the tag.

    Has this tag been deprecated? Is there a better way to do this?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    …placed last in the code designating the link…

    Umm… (X)HTML is not sensitive to order of attributes for a tag. So it doesn’t have to be “last” to work.

    Also, target=”_blank” is perfectly acceptable for the moment (if you’re using XHTML Transitional), but it’s on its way out (as it’s not in XHTML Strict). You really should use rel=”external” instead, with javascript to adjust external links. Google for rel=external for more information.

    And yes, Firefox will happily ignore target tags if the browser is set to do otherwise. There is no longer a reliable way to specify new windows for links. It is generally argued that there should not have been a way to do this in the first place.

    Many thanks, Otto. From now on, it’s rel=”external” for me.

    I’m curious. What are the arguments against allowing me to specify that a link opens in a new window or tab (depending on your browser settings)? When I am navigating someone else’s site, I find it annoying if I have to back my way through four screens to get to whatever I was originally reading, and as a Web author, I want to avoid anything that takes people away from my page so that they might not find their way back.

    Ah, and now I’ve found the setting in my Firefox preferences that led me to believe the “target” attribute was not working. Ya know, there are days when you just seem to know nothing…

    Thanks, everyone.


    I’m curious. What are the arguments against allowing me to specify that a link opens in a new window or tab (depending on your browser settings)?

    It is up to me “a user” to decide if I want to open link in a new window or tab or open it simply over your site.
    If your content is decent and I want to stay on your website I’ll open it in new window with SHIFT+CLICK or CTRL+CLICK. Otherwise I’ll click and go away from your site. Even if you force a link in new window I’ll close your window after.
    As you can walk away from let’s say a shop whenever you want…even if they force u to exit through all shop…you’ll find your way out and go to another.
    People always supose that their page is the one…but hey…one was searching something that you don’t have…why force someone that is not interested in you to stay on your site?
    Let the power of choice to users…as it belongs to them.

    You could use JavaScript to get around the XHTML Strict limitation on target=”_blank”, thus:


    I know it’s a bit hacktastic and to the purists, you’d use the rel=”external” linking method as Otto mentioned. But still, it works.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    I’m curious. What are the arguments against allowing me to specify that a link opens in a new window or tab (depending on your browser settings)?

    Basically, (X)HTML is a language that is supposed to describe content, not behavior. Nowadays we have XHTML to describe content, CSS to describe how that content is displayed, and the user’s browser to display that content. The actual behavior of the interface is not specified anywhere except in the browser itself, although javascript is more and more being used to define that sort of thing.

    Hey, what’s the firefox option that controls this? I was wondering why those weren’t opening links into new tabs as well.

    I understand the arguments behind deprecating this tag, but I find it very annoying to have to find my way back to an article I was reading. I understand it *should* be the users choice, but I never remember to hit [ctrl] when I click on link. From, say, a site manager perspective, you want to try to have people as involved in your site as possible. If I have a long article and want to provide a link to an external site within it, I want to allow the reader to easily come back to finish the article rather than have to navigate back. They won’t.

    Anyway, I just find it easier to close a couple extra tabs than I do to remember to hit [ctrl] when I click a link. but that’s just me.


Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Odd thing with “target=_blank”’ is closed to new replies.