jQERY Inclusion Mechanism (updated)

I think , that we the jQUERY users, all need an official and transparent mechanism for loading the up-to-date jQUERY version.

Anyone using/developing javascript using jQUERY, has a lot of html/js files on her machine, plus “few more” on several sites. When jQery new realease comes, the same one, wants/needs to change each and every of those files , from :

to:

Which is in essence and in reality: impossible. This is where we all should agree on generic mechanism. I suggest jsPAX usage.Where googleapis.com , needs to “play the ball” also. So, the final mechanism would work like this:

This is the ONLY js that has to be included, “ever”

JQLOADER.js contains (specially tweaked?) jsPAX code , plus the following two lines

The same mechanism can be added to the jQuery site, as (for example)

All the other jQ libs/plugins should be in the same on-line folder. so that one can use them in her code,
like this:

Yes, through the “official” jQ extension ‘using()’, which works after jQ is ‘bootstrapped’ by LOADER.JS …
Of course it is the responsibility of the host of the JQLOADER.JS to keep it updated.
This is, IMHO, a safe and useful machanism for loading always the latest versions. Of course one is always
free to use standard js loading, from on-line url’s or locall folders.

Alternatively one can copy the loader to her site, and use it from there:

As every other mechanism it becomes more useful as more ubiquitously it is used.

Update 2009 MAR 11

Ok, since then I changed my mind about jsPAX. Actually not as much about jsPAX as much about the whole inclusion concept vs the jQuery developers (honourable) population.
IMHO, by far the “best” (aka “ideal”) solution would be:

This should be the one and only place from where the whole planet will be including jQuery latest version. With the single, good old script HTML element, with a src attribute.
As you read this everything else becomes obsolete very quickly. XmlHttpRequest is already a de-facto standard. And as a such is to be used for dynamic script inclusion, as well.
Also. Since both Google and Micro$oft have adopted jQuery, it too can be called an “standard”. Intrinsic part of the browser environment.
So: each and every browser developer will just have to include jQuery and use it, for dynamic loading afterwards:

As simple as that.

Technorati Tags: JQUERY