SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    link opeing in new window

    hi there,

    im sorry to post about this as im sure its been asked before but i cant find an answer when i search the forums.

    I want to create a link that opens in a new window. Could ayone tell me how to do this? Is it something to do with onclick or something.

    Also i would like to know how to let less able users know that the link will open in a new window, for accessibility reasons

    Thanks

  2. #2
    Chillin like a Villain DaStuff's Avatar
    Join Date
    Jul 2003
    Location
    Huntington Beach
    Posts
    649
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="http://www.sitepoint.com/" target="new_page">
    Also beware the dangers :P
    http://www.sitepoint.com/article/bew...nks-new-window
    • Follow the dancing banana

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm....Thanks for the link to the article...its made me change my mind now! just for future reference do i literally put new_page in the target speech marks or am i just being dumb?!

  4. #4
    Chillin like a Villain DaStuff's Avatar
    Join Date
    Jul 2003
    Location
    Huntington Beach
    Posts
    649
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup all you would have to do is change the link and whatever link you had would literally open into a new window...

    target="new_page" means that the target for this link is a new page.
    • Follow the dancing banana

  5. #5
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it just me or didn't it used to be
    HTML Code:
    <a href="http://www.thissite.com/thispage.html" target="blank"></a>
    HTMLGuy

  6. #6
    Chillin like a Villain DaStuff's Avatar
    Join Date
    Jul 2003
    Location
    Huntington Beach
    Posts
    649
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think both work... Not sure which one is newer though
    I don't like using it so I didn't really keep up to date on it.
    • Follow the dancing banana

  7. #7
    SitePoint Member animaye's Avatar
    Join Date
    Jul 2006
    Location
    Ohio
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i always though that it was 'target="_blank"' properly? but really, you can put anything in there and your new window is now named whatever you called it (ie: new_page, kittens, george, whatever you called your target=), so any other links you have with the same target name will open in the same window, not necessarily a *new* one, unless you use _blank which forces a new window for each link.
    all this aggravation ain't satisfation' me

  8. #8
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yea, it is _blank! Thanks, I haven't used that in so long it was lost form memory, but I never knew you could use anything...
    HTMLGuy


Bookmarks

Posting Permissions

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