Slide 11.c: JavaScript how to … Slide 11.e: JavaScript where to … (cont.) Home |
body
section will be executed while the page loads.
head
section will be executed when called.
Scripts in the Head Section
Scripts to be executed when they are called, or when an event is triggered, go in the head section. When you place a script in the head section, you will ensure that the script is loaded before anyone uses it. |
|
Scripts in the Body Section
Scripts to be executed when the page loads go in the body section. When you place a script in the body section it generates the content of the page. |
|