On Dec 1, 12:41 am, Scott Sauyet <scott.sau...@gmail.com> wrote:
> On Nov 29, 8:21 pm, breadwild <breadw...@gmail.com> wrote:
>
> > I have seen several examples on jQuery plugin sites that have the
> > <script> tag and Javascript within the <body> and not the <head> where
> > I thought it was supposed to go.
>
> "Supposed to go" is a subjective consideration.  The rationale for
> putting it at the bottom of the body is a fairly simple, and fairly
> persuasive, argument about performance.  A nice short version of that
> is here:
>
>    http://developer.yahoo.com/performance/rules.html#js_bottom

But it doesn't tell the full story - the page will take the same
amount of time to load. Putting scripts at the bottom means that the
page is (possibly) displayed faster and the user has the impression
that it loaded faster.

The best way to improve performance is to reduce images to the minimum
practical size, use plain HTML as much as possible, reduce script to a
minimum and put it into as few files as possible (one or none).


> The rationale for putting it in the head is really one about being
> unobtrusive.

Unobtrusive seems to mean different things to different people.

<URL: http://en.wikipedia.org/wiki/Unobtrusive_JavaScript >

>  If JavaScript is used unobtrusively, then JS is never
> plain data, but always metadata.  And the head is the place for
> metadata.

Javascript is not metadata, it is program code:

<URL: 
http://www.google.com.au/search?q=define%3A+metadata&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a
>


--
Rob

Reply via email to