@NogDogJan 08.2006 — #My question: might you reconsider the need to open a new window? (The basic idea here is that various user agent options may prevent such data from being presented, such as pop-up blockers and other browser options the user may have enabled.)
If you are not worried about this and only care about being able to say, "My markup passed the w3.org validator," then your likely option is to use JavaScript to open the window (which, of course, is probably even more likely to be stopped by pop-up blockers).
@felgallJan 09.2006 — #The current web standards say that you should leave it to your visitors to decide when they want to open a page in a new window and when they want to reuse the existing one. All of the target attributes have therefore been deprecated. You can therefore still get your page to validate if you use a transitional doctype but not with a strict one.
@v_LnJan 09.2006 — #I know you said your site would be 100% w/o javascript but incase you reconsider this will convert your valid links into ones which will open in a new window. and it is not effected by popup blockers.
[code=php]// Create valid external Links
function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; } } window.onload = externalLinks;[/code]
then on whichever links you want to open in a new window use something like :
@FangJan 09.2006 — #- i cant take credit for this script but i cant seem to find where i found it either to give proper credit >.<[/QUOTE] Possibly http://www.sitepoint.com/print/1041
The method adds invalid attributes; your just fooling the W3C validator, but it doesn't make it valid!
Let the user decide. Right click "Open link in ..."