Earlier today I was laying out lists of links to web resources, initially as simple links:
However, this looked a little boring and so thought it would be good to add each site’s favicon (the little icon it shows to the left on a web browser), and have a list like this:
The pages with the lists were being generated, and the icons could have been inserted using a server-side script, but to simplify the server-side code (for speed and maintainability) I put the fetching of favicons into a small JavaScript function using jQuery. The page is initially written (or generated) with default images, and the script simply fills in the favicons when the page is loaded.
The list above is made by hand, but look at this example page to see the script in action.
You can use this in your own web pages and applications by simply including a few JavaScript files and adding classes to certain HTML elements.
See the favicon code page for a more detailed explanation of how it works and how to use it in your own pages.