@felgallMay 01.2006 — #Well since the target attribute is deprecated in HTML (but not yet in Javascript) and since you don't want to have to change the HTML anyway and since CSS can only change the appearance of the links and not what they do you could use the following Javascript:
function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=anchors.length-1; i>=0; i--) { var anchor = anchors[i]; if (anchor.href) && anchor.href.substr(0,7) == "http://") anchor.target = "_blank"; } } window.onload = externalLinks;
@felgallMay 02.2006 — #Well regardless of whether target is supposed to be deprecated or not the Javascript that I posted earlier should make all absolute referenced links (ie. external sites) open a new window (provided Javascript is enabled) without having to specifically change the HTML.
depreciating and deprecating are not the same thing. The value of IE3 and 4 has definitely depreciated to way below zero by now and current browsers still support deprecated tags because there are still validly coded web pages that use them.
Deprecating a tag is the way that the people who write the web standards advise that you should stop using that in your development because there is a better way to do it. It doesn't mean that they expect browsers to stop supporting it any time soon. I guess target isn't deprecated because the expectation is that future web development will allow your visitor to choose whether to open a link in a new window or not.
@slaughtersMay 04.2006 — #Well since the target attribute is deprecated in HTML ...[/QUOTE]Are you really sure about that? I got curious and went to the w3 site and under the HTML4 specification and they mention that the name of a FRAME can be used for targeting:
[I][B]name = cdata [CI][/B]
This attribute assigns a name to the current frame. [B]This name may be used as the target of subsequent links.[/B][/I]
[I]By assigning a name to a frame via the name attribute, authors can refer to it as the "target" of links defined by other elements. [B]The target attribute may be set for elements that create links[/B] (A, LINK), image maps (AREA), and forms (FORM).[/I]
@CharlesMay 04.2006 — #Regarding the "target" attribute. See my note above and then go to http://www.w3.org/TR/REC-html40/sgml/dtd.html . That'll take you to the formal definition of HTML 4.01. It's in a short hand but do a search for "target". You won't find one.
@slaughtersMay 04.2006 — #Regarding the "target" attribute. See my note above and then go to http://www.w3.org/TR/REC-html40/sgml/dtd.html . That'll take you to the formal definition of HTML 4.01. It's in a short hand but do a search for "target". You won't find one....[/QUOTE]Search for "LINK" instead (or scroll about 4 screens down from the top of the document). You'll find a link to the "LINK" element definition : http://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK which includes information on the target attribute
@CharlesMay 04.2006 — #Search for "LINK" instead (or scroll about 4 screens down from the top of the document). You'll find a link to the "LINK" element definition : http://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK which includes information on the target attribute[/QUOTE]Again and as I wrote above, it's not depricated but neither is it still a part of HTML. It fell through the cracks.