So I notice that in all examples, some of the code is in <head> and the rest is in <body>. Must it be this way or can all of the code be in a single <script> element in the body?
Friday, April 29, 2005
You just have to load the script before you try to use it :-) it may be inside body tag as well. Historically it was recommended to load scripts inside header because then older browsers which do not understand script tag will not display it as text (page content).