The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

target="_blank"

DelzhandDelzhand Registered User, Transition Team 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

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.

    Hevach on
  • L Ron HowardL Ron Howard The duck MinnesotaRegistered User regular
    edited March 2011
    Have you tried using the javascript equivalent?

    L Ron Howard on
  • bowenbowen Sup? Registered User regular
    edited March 2011
    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • SeguerSeguer of the Void Sydney, AustraliaRegistered 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)

    Seguer on
  • DelzhandDelzhand Registered User, Transition Team regular
    edited March 2011
    Eh, I figured it out. Something about the Google Analytics module option to track outbound links was doing it.

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

    TwoQuestions on
    steam_sig.png
Sign In or Register to comment.