The onload would have been required if the anonymous functions were, for example, in the <head>. But then, of course, you would have needed to use something other than just onload if there were two.
Fun, isn't it?
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.