I rarely see a situation where the javascript should be or needs to be placed 
anyplace else but the head of the document(Well, except for advertising).
 
But I think it also might have to factor into how a webpage is built. If you 
have a header, left nav, right nav, but only need a script for the main content 
and not for every page than I might write the script inside of the 
content(include) page, although I don't like doing that cause it's considered, 
non-compliant.
 
As for best practices all js and css includes should be placed within the head 
of the document with very few exceptions.
 
POV.
 
 
http://2whoa.com/dominate
 
 


--- On Sun, 8/24/08, bradvin <[EMAIL PROTECTED]> wrote:

From: bradvin <[EMAIL PROTECTED]>
Subject: [jQuery] Best practices for including Jquery
To: "jQuery (English)" <jquery-en@googlegroups.com>
Date: Sunday, August 24, 2008, 8:50 AM

I have been wondering where others feel its best to include jquery and
other .js files in the html.

Include it in the HEAD or at the end of the html document just before
you close the BODY tag?

There are arguments for including it at the end of the document so
that the dom is fully loaded by the time the javascript loads, but
that argument falls away with jquery's ready event. So is it truly
beneficial at the end?

So far i have been including all my .js files in the HEAD with no
problems, as well as all my page specific ready script.

what are others doing and why do you choose to do it that way?



      

Reply via email to