Well, I tried your code and it works, but maybe I should be more specific in my question. The fact is I have my own code and it can detect the URL of a link, but when I try to know the origin of the clicked element contains in a frame it detect the URL but the origin (name of the frame) appear all the frames that I have. Here is my code:
- window.onload=function() {
-
for(x=0;x<window.frames.length;x++){
-
els=window.frames[x].document.body.getElementsByTagName('*');
-
for(c=0;c<els.length;c++){
-
els[c].onclick=function(){
-
getOnclicksm(this);
-
}
-
}
-
}
-
}
-
-
function getOnclicksm(el) {
-
cadena=new String("?COLAB_CLICK=YES");
-
var url=String(el.getAttribute('href'));
-
if (el.tagName=="A"){
-
for(z=0;z<window.frames.length;z++){
-
alert(el.href=el.href + cadena + "\nOrigen: " + window.frames[z].name);
-
}
-
}
-
}
-
as you see I have an alert in my function "getOnClicksm"; it shows a URL with a different string and I want to show the origin frame too but I don't know how can I do.
Thanks again