aspose file tools
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 Groovy Fundamentals video training course this week in the Groovy 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: 15385
There really is no major difference that I am aware of.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: SCRIPT tag inside web page (HEAD vs BODY)