I'm trying to find a creative solution to this one. I know there are alot of scripts out there, many from stackoverflow itself, that can do a 'scan' of the web page through a body onload- but this isn't quite what I'm seeking.
I'm looking for a single script that can be included on the header of the page (via include, so its included on all pages) that detects whether the href the user clicked is external or local, and if it is local it would display a message.
I have a solution already which requires me to include an onClick handler on each href. The problem is this particular site literally has hundreds of hrefs.. I'm looking for a very clean solution that will save me time.
I have a few scripts I'm playing with, I'm just wondering if anyone is familiar with such a way that could easily do this.
I'd prefer Javascript and not Jquery.