Ah, Javascript. The wonderful scripting language that creates lots of cool stuff on your web page. But how do you make it Accessible?
Download Web Axe Episode 11
Links:
This is an example of a javascript “listener” which opens a link in a new window (using a function) if the rel
in the a
tag is “external”.
window.onload=function(){
setOnClick();
}
function setOnClick() {
if(!document.getElementsByTagName) {
return;
}
var anchors = document.getElementsByTagName("a");
for (var i=anchors.length; i !=0; i--) {
var a=anchors[i-1];
if (a.rel.indexOf("external") != -1) {
a.onclick = function(){newWin(this.href,'popup1',700,400);
return false;}
}
}