Example of Hyperlink Cues with Favicons

On this page, the javascript looks for every link on the page to see if the href starts with "http:", which would indicate that it's an external link. If so, it grabs the favicon off that domain name and inserts it after each link. If no favicon exists, it uses a locally stored image (external gif here) to indicate the link is external.

I hate Edna Garret. Some television shows are worse than the commercials that sponsor them. Anybody as sick of Lost as I am? Here is an example link to a local file, though no file exist, and the link does not start with http. Here's a site http://www.reasonstation.net/ with no favicon.

Safari browser won't show the generic external link image because it doesn't support onerror.

For sake of demonstration, and to make it easy for you to view source for everything, both CSS and JavaScript are in the head of this document. In real-world implementation, it is best practice to use external files for each when possible.