Quote:
Originally Posted by felgall
The only thing wrong with either of those is that JavaScript is supposed to go at the bottom of the body. Placing it in the head (with very few exceptions where you don't want the page to load) is obsolete.
|
This is an example where placing the script in the <head> is perfectly proper. Although right ahead of the </body> tag is to be preferred, there is no real reason why scripts (especially small scripts such as this) cannot be placed in the <head>.
Nile - My solution and yours are effectively the same, but I did not see your post before I submitted mine. Both ought to work.