placement of <script

Post here if your topic is about CSS HTML Validator but doesn't fit in another forum.
Post Reply
User avatar
roedygr
Rank V - Professional
Posts: 367
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

placement of <script

Post by roedygr »

W3C says "The SCRIPT element places a script within a document. This element may appear any number of times in the HEAD or BODY of an HTML document."

Do have any thoughts on which is preferable?
User avatar
Albert Wiersch
Site Admin
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: placement of <script

Post by Albert Wiersch »

I think that may depend on what the scripts does, but in general it's probably best to place them right before the end "body" tag if you can, for performance reasons.

Here some more info:
http://stackoverflow.com/questions/4364 ... tml-markup
http://webdesign.about.com/od/speed/a/s ... -speed.htm
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply