spice up boring lists of web links – add favicons using jQuery

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:

  jQuery home page

  Wikipedia page on favicons

  my academic home page

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.

Gordon’s example to us all

Last night I read a BBC article on Gordon Brown’s earnings since he stopped being Prime Minister a few years ago.  I felt a lump coming to my throat as I read the story.  Ex-PMs typically have lucrative post-government careers with lecture tours and the like.  Gordon Brown has similarly earned 1.4 million pounds in lecture fees and book royalties, but then given it all away.

In the run up to the General Election in 2010 I wrote how I gradually warmed to Gordon Brown during the campaign as it became increasingly clear that he was a man of true integrity.  This is another indication of that integrity, and utterly amazing to see in the modern world.

Of course he was not pretty like David Cameron or Nick Clegg, nor could he control his irritation when faced with objectionable, if popular, views.  In short, not a showman, nor a celebrity, not slick, not ‘political – just a genuinely good man.

It is sad that that is not sufficient to impress the 21st-century voter.

Dinner or tea, lunch or dinner – signs of class or the times

I was pondering the words of the old advertising jingle1:

I like a nice cup of tea in the morning,
Just to start the day you see;
And at half past eleven,
Well my idea of heaven,
Is a nice cup of tea.

I like a nice cup off tea with my dinner,
And a nice cup of tea with my tea,
And about this time of night,
What goes down a treat, you’re right,
It’s a nice cup of tea.

As well as the deep truth underlying the words, I suddenly became aware of the beginning of the second stanza: “a nice cup of tea with my dinner, and a nice cup of tea with my tea“.

I’d guess the last part of this may be confusing to a non-UK audience, or it may conjure up images of period-drama afternoon tea with cucumber sandwiches and parasols over a game of croquet.

Now the meaning of ‘dinner’ has been a matter of discussion in my household for years.

When I was a child ‘dinner’ was the light meal in the middle of the day, whereas ‘tea’ was the main meal at around 6 o’clock.

In contrast, Fiona takes a more pragmatic approach: ‘dinner’ is the main meal whether taken midday or in the evening.

My impression is that, when I was a child, this was part of a general class distinction. Posh (middle class) people ate lunch at midday, dinner in the evening, watched BBC and drank coffee. The working class ate dinner at midday, ate tea in the evening, watched ITV (the channel with adverts), and drank tea.

Weirdly in school one had ‘school dinners’ or ‘free dinners’ if on benefits, but had ‘packed lunches’.

We have sometimes discussed whether the tea/dinner distinction was more a Welsh-ism. But the advertising jingle clearly shows it was widespread2.

Now-a-days I tend to use the words rather interchangeably, and certainly happy to use ‘lunch’. Is this because I have become part of the professional classes or a general shift of language?

What do you call meals? Is it the same as when you were little? Is it still a class distinction?

  1. According to responses in AnswerBank, this was from an original 1937 song for Brook Bond ‘D’ brand … and in fact the word ‘tea’ was replaced by ‘D’ … but I obviously missed this and remember it as ‘tea’!  The original lyrics have slightly different final lines, “And when it’s time for bed, There’s a lot to be said, For a nice cup of tea“, or maybe I simply misremembered the advert.[back]
  2. even in 1937[back]