www.webdeveloper.com
Results 1 to 8 of 8

Thread: links to other websites

  1. #1
    Join Date
    Dec 2005
    Posts
    33

    links to other websites

    how do i make my links open in a new window so my site stays on?

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Code:
    <a href="http://www.w3.org/" onclick="window.open (this.href, 'child'); return false">W3C</a>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Mar 2005
    Location
    Idaho, USA
    Posts
    209
    Charles, much appreciated. But why the change from the old <target="_new"> or <target="_blank">? (I never really liked either of those anyway.) Is your example more consistant across browsers?

    Thanks.
    The Old Sarge

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Because the "target" attribute was removed from HTML back in 1997 ( http://www.w3.org/TR/REC-html40-971218/ ).
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Dec 2006
    Posts
    10
    it still works.....

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Mugging works too but it's not a respectable occupation.

    We have two methods that work so they each get one point. One's legit the other not so much so the JavaScript method gets another point. That's two to one against using "target".
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  7. #7
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,972
    Quote Originally Posted by Charles
    Mugging works too but it's not a respectable occupation.
    Even if that analogy is ridiculous even by Charlie's standards, there is some sense in what he is saying.
    Although both techniques work, the target attribute is known by browsers to be depreciated and they have no reason to see a document including this attribute and render it in standards compliance mode.
    To use a slightly tamer analogy, planes and glass paper can both be used to smooth down a knot of wood, but glass paper doesn't screw up the rest of your surface.
    Disclaimer. (1) Whilst I will help you sometimes, if I feel like it, and my advice in relation to your actual question will be of good quality: my posts are to be taken with a pinch of salt. I will be sarcastic, deploy irony and include obscure cultural references for my own amusement without warning.
    (2) You will gain nothing from complaining, and if you try to argue with me then you will not win. No matter how noble your battle seems, I am still better than you, don't be an hero.

  8. #8
    Join Date
    Mar 2005
    Location
    Idaho, USA
    Posts
    209
    Thank you both. Every little tidbit helps.
    The Old Sarge

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles