![]() ![]() |
Is it possible to run a code or a function on link click to manipulate the clicked link url?
|
![]() ![]() |
You need to attach an event handler to the link (element.addEventListener). Then you can do whatever you want. See Pitfall #2 here: http://www.oreillynet.com/pub/a/network/2005/11... |
![]() ![]() |
Thanks for the reply.
|
![]() ![]() |
Some events can be intercepted by an element that contains the element that's actually clicked. You could try adding a click event listener on the page and see whether you can detect it there. function gotClicked(e){
if (e.target.nodeName.toLowerCase() = "a"){ // it's a link!
// some actually useful code
}
}
|


