Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can i let this code open in a new page?

    Sow i know how to at
    Code:
    target="_blank"
    normally but i got this code in wp and i tried to paste it in the code where i need it but it doesnt work.

    Such a noob question but always worked with wyiwyg stuff so coding is a bit new for me

    I need this code to open in a new page
    Code:
    <a href="https://www.facebook.com/lowikvandevelden"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154" /></a>

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    http://www.w3schools.com/html/html_links.asp
    Code:
    <a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know that code cause i used it already on a link like that but as you can see, the link i use now is quiete long and i tried to paste the taget blank on different spots in the code but it doesnt work. Everytime i click the image it opens on the same page

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,462
    Thanks
    0
    Thanked 633 Times in 623 Posts
    Why are you trying to eliminate ways that your visitors can open the link. All browsers generally allow you to select from same tab, new tab or new window when you right click on a link and adding one of those long dead target thingies will at best stop them from being able to choose one of the three (or more) alternatives that they will ordinarily have.

    Some browsers even allow you to predefine how different sorts of links will be opened (my browser is configured to open links within a site in the same tab and external links in a new tab) - depending on how the browser is set your target will either be ignored or will annoy your visitor by blocking their selected choice.

    That's why target was deleted from HTML back in 1997.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont know if it is deleted but i do know it still is used and i want my link like that because most people dont have their browsers set to open everything in a new tab.

    Look, i need to do this multiple times, what i want is when people clink the fb icon it goes in a new tab.

    You can find my page here

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by felgall View Post
    That's why target was deleted from HTML back in 1997.
    No it wasn't. It's currently a part of HTML5

    http://www.w3schools.com/tags/tag_a.asp
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by kayiro View Post
    I know that code cause i used it already on a link like that but as you can see, the link i use now is quiete long and i tried to paste the taget blank on different spots in the code but it doesnt work. Everytime i click the image it opens on the same page
    So this doesn't work?

    Code:
    <a href="https://www.facebook.com/lowikvandevelden" target="_blank"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154" /></a>
    I just checked your page and clicked on the image links where you have the target attribute and it does indeed work. Are you sure you were clicking on the right ones? You didn't apply the target attribute to all of them.
    Last edited by Spookster; 11-30-2012 at 12:06 AM.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    Quote Originally Posted by kayiro View Post
    […] i do know it still is used and i want my link like that because most people dont have their browsers set to open everything in a new tab.
    Maybe that’s because they don’t want links to open in new tabs/windows, or rather, they expect links to open in the same window. Why would you wanna force your perception on them?

    Quote Originally Posted by Spookster View Post
    No it wasn't. It's currently a part of HTML5
    Yes, it was. It was not part of (strict) HTML 4 and XHTML 1. It was only re-added to HTML 5 because HTML 5 is tag soup reloaded. That doesn’t mean it’s good practice to use it.

    But let’s not start a debate on basic principles. felgall has made his point and I tend to agree with him, so whoever wants to follow does, and the other ones can go to hell.

    All Hail Spookster!!
    Last edited by Spookster; 11-30-2012 at 12:24 AM.

  • #9
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by VIPStephan View Post
    Yes, it was. It was not part of (strict) HTML 4 and XHTML 1. It was only re-added to HTML 5 because HTML 5 is tag soup reloaded. That doesn’t mean it’s good practice to use it.

    But let’s not start a debate on basic principles. felgall has made his point and I tend to agree with him, so whoever wants to follow does, and the other ones can go to hell.

    All Hail Spookster!!
    Problem solved!
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    You are some kind of jester.

  • #11
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi,

    Please try this code,


    <a href="https://www.facebook.com/lowikvandevelden" target="_blank"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154"></a>


  •  

    Posting Permissions

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