Open link in new window

Discussion in 'How to use templates' started by pusscat, Oct 20, 2009.

  1. pusscat New Member

    Am currently editing a template, and have forgotten how to write the link in the code so that it opens in a new window, there are only a few links and pages that I want to open that way.

    Can someone please refresh my memory

    Thanks

    Angie
  2. grodt718 New Member

    Hi,There

    Is This What Your Looking For?
    <atarget="_blank" href=
  3. pusscat New Member

    I just tried that and it didnt work for some reason unless have put the code in wrong this is what I added and how I added it, it stopped the link working for some reason


    <atarget="_blank" href="http://www.tutorial-writers-inc.com">Tutorial Writers Inc.</a>

    By the look of it the second word TUTORIAL is somehow in the link and it shouldnt be as that is the link name you click well part of it

    as you click on Tutorial Writers Inc to go to the site.

    If that makes any sense


    Angie
  4. ishkey Mod - Designer

    Try this instead
    Code:
     
    [B]<[COLOR=#800000][COLOR=#800000]a[/COLOR][/COLOR][/B] href="[U][COLOR=#0000f0][COLOR=#0000f0]http://www.tutorial-writers-inc.com"[/COLOR][/COLOR][/U] target=[B]"_blank">[/B] Tutoral Writers Inc[B]</[COLOR=#800000][COLOR=#800000]a[/COLOR][/COLOR]>[/B]
    
    Here is the code from one of my sites the "target" references the company name and the link to click on is a graphic which is the linestarting with <img scr=
    Code:
    [B][B]<[COLOR=#800000][COLOR=#800000]a[/COLOR][/COLOR][/B] href=[B]"[/B][U][COLOR=#0000f0][COLOR=#0000f0]http://www.vansicklepaint.com[/COLOR][/COLOR][/U][B]"[/B] target=[B]"vansickle"><[COLOR=#800000][COLOR=#800000]img[/COLOR][/COLOR][/B][SIZE=1][SIZE=2] src=[B]"link_images/VanSickle.jpg"[/B] border=[B]"0"[/B] width=[B]"200"[/B] height=[B]"49"[/B] alt=[B]"Quality Paints Since 1907"[/B] hspace=[B]"15"[/B] [/SIZE][B][SIZE=2]/></a>[/SIZE][/B][/SIZE][/B]
    
  5. bmcoll3278 New Member

    it would be
    <a href=href="http://www.tutorial-writers-inc.com"target="_blank">Tutorial Writers Inc.</a>
    That wont pass xhtml 1.0 but will work. If you want to pass xhtml1.0 standard do it like this

    <a href="http://www.tutorial-writers-inc.com"onclick="target='newwindow'">Tutorial Writers Inc.</a>

    did you know that Dave?
  6. pusscat New Member

    Thanks but tried the last one posted and it didnt work either link opened in the same page.

    Also my browser came up with a yellow bar at the top saying your browser doesnt allow active x scripts to run yada yada yada usual microsoft stuff.

    Put the code back to how it was originally and got rid of the yellow bar, hmm wierd me thinks.

    I do want my pages to validate correctly hence why chose that one to try

    am now stuck as to what to do

    Thanks

    Angie
  7. ishkey Mod - Designer

    i messed up but this works in ie8, 7, 6
    Code:
    [B][SIZE=1]<[/SIZE][SIZE=1][COLOR=#800000][SIZE=1][COLOR=#800000]a[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=1] href=[B]"[/B][/SIZE][U][SIZE=1][COLOR=#0000f0][SIZE=1][COLOR=#0000f0]http://www.tutorial-writers-inc.com[/COLOR][/SIZE][/COLOR][/SIZE][/U][B][SIZE=1]"[/SIZE][/B][SIZE=1] target=[B]"_blank">[/B]Tutoral Writers Inc[B]</[/B][/SIZE][B][SIZE=1][COLOR=#800000][SIZE=1][COLOR=#800000]a[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1]>[/SIZE][/B]
    
    The graphic shows the link and the window it opened

    Attached Files:

    • iy.jpg
      iy.jpg
      File size:
      68.1 KB
      Views:
      341
  8. pusscat New Member

    Thank you, Thank you, thank you, that worked for me.

    Final bit of tweaking and then time to upload to my site,

    But its 1am in the UK so that will wait till tomorrow me thinks

    Thanks again

    Angie
  9. bmcoll3278 New Member

    Sorry it did not work for you. I pated the code into one of my pages and it works great. But maybe only if active x is enabled
  10. pusscat New Member

    No problem Bmcoll,

    I have activeX enabled, I think more than it being IE that its possibly Kaspersky being sensitive etc, its picked alot of websites up as having links to phishing sites etc now whether they are is a different matter lol.

    But I need a really good anti virus and firewall etc and its not let me down yet.


    Thanks for trying


    Angie
  11. grodt718 New Member

    Hi,

    Just copy & paste

    <a target="_blank" href=http://www.tutorial-writers-inc.com" title="Writers Inc.">Writers Inc.</a> ;)
  12. pusscat New Member

    Thanks Grodt
  13. grodt718 New Member

    No Problem

    And welcome to FWT The best template site on the net, You will find lots of great help here, And best of all it's FREE...YES!:eek:
  14. pusscat New Member

    Thanks Grodt,

    I came across the site looking for a template, some nice ones here aswell, but unfortunately not one that could use on my site at the moment.

    Can write html to a point but css goes straight over my head pretty much, some of it I can understand and other bits erm well not so easy, will have a play with the templates one day to learn more,
  15. bmcoll3278 New Member

    Thanks you learned me somethin new.
    But you need a space between the a and target.

    Just the same thanks for showing us something new.
    <a target="_blank" href=http://www.tutorial-writers-inc.com" title="Writers Inc.">Writers Inc.</a>
  16. grodt718 New Member

    Hi, everyone

    :DThanks, And no problem "what ever lil i know you'll know"...