How Do I Use target=blank correctly please?

by pace
20 replies
I am in the process of building a very lage website in the Health & Fitness niche

Although each page has a navigation bar with links back to the home page and an A to Z index, I want each page [link] to open in a new window

For example I want to know what I should put in the hyperlink from the page www.mywebsite/category1 so that www.mywebsite/category1/article1 opens in a new window

I use Microsoft Frontpage

Hope you can understand that!

Thanks
#correctly #targetblank
  • Profile picture of the author Loren Woirhaye
    It's target=new

    ie.

    Code:
    <a href="http://warriorforum.com" target=new>Warrior Forum</a>
    {{ DiscussionBoard.errors[1756409].message }}
    • Profile picture of the author JohnMcCabe
      Loren, target="_blank" works as well, but you need the leading underscore, like this:

      Code:
      <a href="http://www.mywebsite/category1/article1" target="_blank">whatever</a>
      {{ DiscussionBoard.errors[1756443].message }}
      • Profile picture of the author Stefan Vee
        This works too (lol):

        Code:
        <a href="http://www.whatever.tld" target="lol">whatever</a>
        {{ DiscussionBoard.errors[1756461].message }}
        • Profile picture of the author ozduc
          I would find that very annoying if I was on a site and every link within the site opened in a new window. I would only use that feature when adding a link to an external site.
          If you have the navigation bar and A-Z index on every page why would you need each page to open in a new window?
          {{ DiscussionBoard.errors[1756484].message }}
  • Profile picture of the author bollytintin
    target=new?

    Not sure I have heard or seen that before. will surely try it out and see its effect.

    I am only aware of target="_blank"
    {{ DiscussionBoard.errors[1756476].message }}
    • Profile picture of the author Stefan Vee
      You're basically opening (and naming) a new window with the target-call.
      You can name it anything!
      {{ DiscussionBoard.errors[1756480].message }}
  • Profile picture of the author bollytintin
    I second ozduc.

    If you have hundred pages that equals one hundred windows?
    not sure anyone will stay on your site after 5 windows.
    {{ DiscussionBoard.errors[1756496].message }}
  • I wouldn't use it for internal navigation. What a nightmare. I use it on external links when I want my site to remain open BEHIND the new window.

    Each parameter does different things... NEW and BLANK are not the same.

    BLANK ensures a new window is opened each time... NEW doesn't.
    {{ DiscussionBoard.errors[1756508].message }}
    • Profile picture of the author Stefan Vee
      Originally Posted by InternetMarketingIQ View Post

      I wouldn't use it for internal navigation. What a nightmare. I use it on external links when I want my site to remain open BEHIND the new window.

      Each parameter does different things... NEW and BLANK are not the same.

      BLANK ensures a new window is opened each time... NEW doesn't.
      You're soo wrong!
      Each time you call the target frame something differently, a new target window opens ...
      Try It!
      {{ DiscussionBoard.errors[1756516].message }}
    • Profile picture of the author CDarklock
      Originally Posted by InternetMarketingIQ View Post

      _blank ensures a new window is opened each time... anything else doesn't.
      FTFY

      You can type whatever you want in there as the name of the new window. But if you want to have some fun, use the same thing on two different sites - use target="new", for example, and you click on the first link to open a brand new window named "new" with that link in it.

      Now go to the second site, click on a link, and it opens that link in the EXISTING window named "new" that you just opened from the other site.

      You may actually want this, but chances are you don't.
      Signature
      "The Golden Town is the Golden Town no longer. They have sold their pillars for brass and their temples for money, they have made coins out of their golden doors. It is become a dark town full of trouble, there is no ease in its streets, beauty has left it and the old songs are gone." - Lord Dunsany, The Messengers
      {{ DiscussionBoard.errors[1756523].message }}
  • Profile picture of the author WD Mino
    Cross browser code is <a href="yourdomian/file" Target="_blank"></a> if you were wanting to make a banner opening you just use the img src same format target="_blank">
    Signature

    "As a man thinks in his heart so is he-Proverbs 23:7"

    {{ DiscussionBoard.errors[1756524].message }}
    • Profile picture of the author Airwalk Design
      <a href="URL" target="_blank">Link</a>
      {{ DiscussionBoard.errors[1756534].message }}
  • Profile picture of the author Dennis Gaskill
    So many misconceptions!

    target="_blank"

    ...opens the link in a new, unnamed window


    target="new" ...is the same as target="fred" or target="pudding"

    ...you're just giving the new window a name (unless you're using frames, but that's another story). These last examples all open the link in a window named whatever the target name is that you use. The advantage of this is if you code all your links with the same target name, if someone keeps the window open with that name, new links will open in that window instead of opening a new window every time.

    You can also also just put one link in the HEAD section of your page to have all links on the page open in a new, unnamed window. That way you don't have to include the target attribute with each link. Here's how to do that:

    <head>
    <title>Page Title</title>

    <base target="_blank">
    </head>

    Questions?
    Signature

    Just when you think you've got it all figured out, someone changes the rules.

    {{ DiscussionBoard.errors[1756570].message }}
    • Profile picture of the author Kat Bartone
      There's also target="_top".

      Here's some info on all of them:

      HTML Target Attribute of the Link Anchor

      HTML a target Attribute
      Signature

      Your search for the perfect WordPress theme is over. Here it is.

      Coming soon: Compelling Content from the PLR Article Wizard

      {{ DiscussionBoard.errors[1756630].message }}
    • Profile picture of the author mywebwork
      Originally Posted by Dennis Gaskill View Post

      So many misconceptions!

      target="_blank"

      ...opens the link in a new, unnamed window


      target="new" ...is the same as target="fred" or target="pudding"

      ...you're just giving the new window a name (unless you're using frames, but that's another story). These last examples all open the link in a window named whatever the target name is that you use. The advantage of this is if you code all your links with the same target name, if someone keeps the window open with that name, new links will open in that window instead of opening a new window every time.
      Dennis is of course correct, unless "_blank" is specified you are actually specifying the name of the specific window or frame you are targeting.

      Dennis I do actually have a question - this is at least the second thread in which I've seen you mention "pudding". Is there a story behind this - are you perhaps a reformed pudding addict?

      :confused:

      Bill
      {{ DiscussionBoard.errors[1757400].message }}
      • Profile picture of the author Dennis Gaskill
        Originally Posted by mywebwork View Post


        Dennis I do actually have a question - this is at least the second thread in which I've seen you mention "pudding". Is there a story behind this - are you perhaps a reformed pudding addict?

        :confused:

        Bill
        No Bill, I'm not a reformed pudding addict, I'm an unreformed goof! I just think it's a funny word to interject for a wee little unexpected humor...such as it is. I use "Fred" a lot too.

        Now stop stalking me!

        Two things I want to add after reading Istvan's post. First, Istvan, I hope you understand I wasn't endorsing opening new windows. I generally think it's a bad idea, although I believe there are appropriate exceptions. I was merely answer the OP's question.

        Second, depending on how a person has their browser set up, using the target attribute often opens the link in a new tab rather than a new window.
        Signature

        Just when you think you've got it all figured out, someone changes the rules.

        {{ DiscussionBoard.errors[1757548].message }}
        • Profile picture of the author Istvan Horvath
          Originally Posted by Dennis Gaskill View Post

          First, Istvan, I hope you understand I wasn't endorsing opening new windows.
          I do. After reading many of your posts here I have a better opinion of you than to assume you would endorse it.
          Signature

          {{ DiscussionBoard.errors[1757725].message }}
  • Profile picture of the author Istvan Horvath
    All that is kewl (as my teen nephew used to say) - but if I set my browser to override it then your code will do nothing. And I do override your code! Because I will not let any confused webmaster to dictate how MY browser behaves on MY computer. I open new tab when I want; I mean tab not window...
    Signature

    {{ DiscussionBoard.errors[1757303].message }}
  • Profile picture of the author pace
    Thanks to everyone for their thoughts and contributions on this subject
    {{ DiscussionBoard.errors[1758018].message }}
  • Profile picture of the author UnseenRevolution
    Yes, target='_blank' is correct for new windows. I would suggest only opening new windows if you are sending people to a new site. It is a way of keeping people from totally leaving your site.

    I use jQuery to modify the links and create the new window. It does all the work. Looks at all the links and adds the target='_blank' to any link not on your domain. Works all the time for every external link and saves you a bunch of time exiting HTML.

    A tutorial and all the code is available from the link in my sig.

    Cheers!
    {{ DiscussionBoard.errors[4351739].message }}

Trending Topics