View Full Version : Determining when any link is clicked on a page

07-28-2006, 07:33 AM
How could I determine when ANY link on a page is clicked and what that link points to without having to add a function call into onClick of every href tag?

07-28-2006, 07:57 AM
Yes... but it would be better if you used Unobtrusive JavaScript, which would add the onclick event handler to each link when the page loads.

Behavioral Separation (http://www.alistapart.com/articles/behavioralseparation/)
Unobtrusive JavaScript (http://www.onlinetools.org/articles/unobtrusivejavascript/)
DOM Scripting - Sample chapter: Best Practices (http://www.domscripting.com/book/sample/)
Accessible DHTML (http://www.severnsolutions.co.uk/articles/001/)

07-28-2006, 08:10 AM
Where will the information be going to? Or is this just for your own testing locally?

07-28-2006, 04:54 PM
It would be going back to the server that hosts the page. I am conducting usability tests.