M
Matej
Hi,
I try to assign my function to one <A> element in this GM script, but
it doesn't work as hoped for (after pressing Alt+L in Firefox 1.5
nothing happens). Does anybody see what I am doing wrong here?
window.openNewLocation = function() {
alert("OK");
}
var ATags = document.getElementsByTagName("a");
var hrefArray = window.location.href.split("/");
hrefArray[hrefArray.length-1] = "gallery";
var imageHREF = hrefArray.join("/");
// window.open(this.href,'extern').focus();return false"
// http://cingular.rbmfrontline.com/locations
for (var i = 0; i < ATags.length; i++)
{
tempElem = ATags;
if (tempElem.getAttribute("href") ==
"http://cingular.rbmfrontline.com/locations") {
tempElem.accesskey = "L";
tempElem.onClick = "function() {openNewLocation();return false}";
GM_log('attributes = ' + String(tempElem.onClick));
}
};
Thanks a lot,
Matej
I try to assign my function to one <A> element in this GM script, but
it doesn't work as hoped for (after pressing Alt+L in Firefox 1.5
nothing happens). Does anybody see what I am doing wrong here?
window.openNewLocation = function() {
alert("OK");
}
var ATags = document.getElementsByTagName("a");
var hrefArray = window.location.href.split("/");
hrefArray[hrefArray.length-1] = "gallery";
var imageHREF = hrefArray.join("/");
// window.open(this.href,'extern').focus();return false"
// http://cingular.rbmfrontline.com/locations
for (var i = 0; i < ATags.length; i++)
{
tempElem = ATags;
if (tempElem.getAttribute("href") ==
"http://cingular.rbmfrontline.com/locations") {
tempElem.accesskey = "L";
tempElem.onClick = "function() {openNewLocation();return false}";
GM_log('attributes = ' + String(tempElem.onClick));
}
};
Thanks a lot,
Matej