This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes SCRIPT tag inside web page (HEAD vs BODY) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "SCRIPT tag inside web page (HEAD vs BODY)" Watch "SCRIPT tag inside web page (HEAD vs BODY)" New topic

SCRIPT tag inside web page (HEAD vs BODY)

Manio Manegra

Joined: Sep 15, 2006
Posts: 8
Hello everybody,
I'd like to know if there is any difference placing your SCRIPT tag inside HEAD tag instead of putting into BODY tag.
I know that conceptually you should put your SCRIPT tag in the HTML header section if its code is about a deferred action, but the main point is: what is the difference in browser behavior in those two scenarios?

Anyone could help?

Bye Manio
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
There really is no major difference that I am aware of.

I agree. Here's the link:
subject: SCRIPT tag inside web page (HEAD vs BODY)