Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

target="_blank"

DelzhandDelzhand motivatedbattle programmerRegistered User regular
edited March 2011 in Help / Advice Forum
Despite target being a deprecated element in XHTML strict 1.0, and a generally bad practice, I have a client website that wants links to external sites to open in a new tab/window. I've tried to push back on this, but they don't want people "taken away from their site".

So I've set target blank on a lot of links leading to other sides, but for some reason, independent of browser, the links are opening not just in a new tab, but in the original too.

It's a drupal site, and the primary use case is links created in the tinyMCE editor, but even when I tried to test it by hard-coding a link into the template files it still happens. Neither drupal or the editor are adding anything to the anchor tags.

I'm not looking for someone to solve this problem for me, just some ideas on where to look or what might cause this. If someone wants to look at one of the pages in question I can PM a link, though.

Delzhand on
9KKPPQw.png

Posts

  • HevachHevach Registered User regular
    edited March 2011
    Some versions of IE have a (as far as I know unpatched) bug that ignores it entirely, but Firefox should open any link like this in a new tab. How's your formatting exactly? Should be:

    <A HREF="url" TARGET="_blank">text</A>

    If you missed a quote or used a ' somewhere, I think that would break it.

  • L Ron HowardL Ron Howard Registered User regular
    edited March 2011
    Have you tried using the javascript equivalent?

    steam_sig.png
  • bowenbowen Registered User regular
    edited March 2011
  • SeguerSeguer Registered User regular
    edited March 2011
    Hevach wrote: »
    Some versions of IE have a (as far as I know unpatched) bug that ignores it entirely, but Firefox should open any link like this in a new tab. How's your formatting exactly? Should be:

    <A HREF="url" TARGET="_blank">text</A>

    If you missed a quote or used a ' somewhere, I think that would break it.
    Use lowercase tags and attributes.



    XHTML Strict will not accept the target attribute, XHTML Transitional will.

    Otherwise you can use javascript to open them (if you have access to the rel attribute, you can put rel="external" then run JS to catch clicks on those links)

  • DelzhandDelzhand motivated battle programmerRegistered User regular
    edited March 2011
    Eh, I figured it out. Something about the Google Analytics module option to track outbound links was doing it.

    9KKPPQw.png
  • TwoQuestionsTwoQuestions Registered User regular
    edited March 2011
    Gotta love the dangers of framework bloat. I've also been bitten by that one or twice.

    steam_sig.png
Sign In or Register to comment.