Since the target attribute is a no no, I made this script I use in
conjunction with Simon Willison's addloadevent script:
http://simon.incutio.com/archive/2004/05/26/addLoadEvent
This is an example, the rel values are for guidance. If you, like me,
are picky, remember to link to a profile in the html if you use
custom rel values; the format of which, I'm afraid, will never be
decided.
var POPUP = {
open : function(link,uri,window,arg) {
linkys.onclick = function(){
window.open( uri, window, arg);
return false;
}
},
init : function() {
var linkys = document.links;
var arg,window;
for (var i=0; i<linkys.length; i++){
if (linkys[i].getAttribute('rel')) {
switch (linkys[i].getAttribute('rel')){
case "faveones":
argumentos = "";
ventana = "faveones";
break;
case "related":
argumentos = "";
ventana = "related";
break;
case "moreinfo":
argumentos = "";
ventana = "moreinfo";
break;
default:
ventana = "_self";
argumentos = "";
break;
}
POPUP.open(linkys[i],linkys[i].href,window,arg)
}
}
}
}
This way I can have A's with rel tags that provide extra meaning (like
related/extended, section, index and the like) and based on that I
open new windows or not. It is unobtrusive, as I use no onclicks
inside the html.
I write this in a rush, hope it's clear.
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************