Re: javascript in <head> or in <body> ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2007-08-11 at 12:15 -0400, tedd wrote:
> At 9:29 PM +0200 8/7/07, Tijnema wrote:
> >On 8/7/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
> >  > Yeah!! This list is for public apologies and Copyright discussion.
> >>
> >>  Cheers,
> >>  Rob.
> >>  --
> >
> >Oh yeah, Tedd is only the first of thousands of people that need to
> >apologize... :P
> >
> >Tijnema
> 
> 
> Ah crap, have I got something else to apologize for?
> 
> At this rate, by the time I reach the end of my life, I'll know only 
> two sentences, namely "I'm sorry" and "Yes, Dear".
> 
> Oh, to bring this off-topic question back to on-topic (?)
> 
> Always (fishing for another apology opportunity) place javascript in 
> external files and call them in via the header. Keep the code 
> unobtrusive. There are ways to use javascript without having to mix 
> it into your html -- look up DOM scripting.

I absolutely agree with unobtrusive JavaScript, but I do disagree with
you slightly on using external files. Generally speaking i keep large
bits of code (Especially libs) in external files, but a few lines of
script for a form that appears on one page I'll often be put in the head
section. This way the JavaScript is in the same file as the template for
which it is associated. My template engine will relocate the JavaScript
to the <head> section at compile time.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux