Whilst working this morning I wrote this piece of javascript for unobtrusively changing a parent window location from a clickable map
function map()
{
if (!document.getElementsByTagName) return false;
if (!document.getElementById) return false;
var mapLinks = document.getElementsByTagName(”area”);
for (var i = 0; i < mapLinks.length; i++)
{
if(mapLinks[i].className==’getform’)
{
mapLinks[i].onclick=function()
{
var destination= this.getAttribute(’href’);
openform(destination);
return false;
}
}
}
}
function openform(destination)
{
this.opener.location.href=destination;
this.close();
return false;
}
But it just occurred to me is this, although unobstrusively written, obtrusive to control other windows? Is this accessible (would a screen reader be notified ?)
I think I need to check before I unleash this.
Technorati Tags: javascript, unobtrusive javascript, opening widows, accessibility
