NYCPHP Meetup

NYPHP.org

[nycphp-talk] JavaScript just above form in body?

Michael B Allen ioplex at gmail.com
Wed Feb 6 18:11:56 EST 2008


On 2/6/08, John Campbell <jcampbell1 at gmail.com> wrote:
> > How about src-ing a .js? I've been looking at random pages and I'm
> > surprised to see that not many pages actually do this. Is there a
> > reason?
>
> For non-library code, it is faster to include the javascript with the
> html because it saves a web request.  For library code, it is a
> trade-off... an extra web request vs loading the js from the cache
> during subsequent page views.
>
> I also think creating a js file for each page is painful.  When you
> change the html you generally have to change the javascript, so why
> not keep it in one place?

I was not going to have a .js for each page. I think one .js will do.
And I don't see how this is any different from another cached .gif or
.css.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/



More information about the talk mailing list