Page 1 of 1

placement of <script

Posted: Tue Apr 15, 2014 2:30 pm
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?

Re: placement of <script

Posted: Tue Apr 15, 2014 3:27 pm
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