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
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: http://aspose.com/file-tools
subject: SCRIPT tag inside web page (HEAD vs BODY)
Similar Threads
Is there any difference if we mentin the script tags inside the Head Tag and the body Tag :
Animate method not working using easeofBounce
Scripts inside the head tag
enabling button when text field changes