By default, WordPress loads the version of jQuery that comes with the package. But there is an alternative way of doing it and that’s to use the AJAX Libraries API at Google Code – use their bandwidth, why not…
A few lines added to your functions.php in the theme you’re building and you’re ready to go.
wp_register_script() – the useful point is that you can use this function to access scripts hosted elsewhere…
Just add this code to your functions.php file:
add_action('template_redirect', 'js_head_load');
function js_head_load(){
if(is_admin()) return;
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js');
wp_enqueue_script('jquery');
// and then any other scripts to register and queue...
}
Notice the first line of the function ensures that the jQuery isn’t loaded on WP admin pages - if a script isn’t needed, don’t load it on the page – and in this case jQuery in noConflict mode can cause the admin rich text editor and the widget drag and drop interface to go awry..
The advantages:-
You’ll be able to update the version your site is using quickly and easily, probably a good thing.
Google Code tends to have a policy of only including versions demonstrated to be stable, jQuery 1.2.4 and 1.2.5 didn’t make the grade
The user may already have it cached in their browser via some previously visited site instead of downloading from a location on your site (and if enough sites do it, the chances are that much greater that they will have a copy in the cache).
Not just jQuery – check out jQuery UI
http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js
And MooTools, which seems seriously under-used in conjunction with WordPress
http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js
Always grab the minified version.
And lastly, one disadvantage:- googleapis.com does go down very occasionally – but then again a site ought to function, more or less, without javaScript.

