I'm developing sites using Wordpress and I want to use the lates version of jQuery.
To make sure I use the lates version, I have found this piece of code from Binary Bonsai's example.
What I see, is that he actually links to jQuery at Google API.
So my question is, what is better.
To link to jQuery on an external page?
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
or to have the jquery file locally?
wp_enqueue_script('jquery', '/js/jquery-1.4.2.min.js');
UPDATE
Thanks to Colin, the answer is actually here:
http://stackoverflow.com/questions/2180391/why-should-i-use-googles-cdn-for-jquery
But tjust in case you don't have Google
in your search term, like me, I'll copy the answer from John Gietzen
It increases the parallelism available.
(Most browsers will only download 3 or 4 files at a time from any given site)It increases the chance that there will be a cache-hit.
(As more sites follow this practice, more users have the file already ready.)It ensures that the payload will be as small as possible.
(Google can pre-gzip-compress the file, making the time-to-download very small.)It reduces the amount of bandwidth used by the server.
(Google is basically offering free bandwidth.)It ensures that the user will get a geographically close response.
(Google has servers all over the world, further decreasing the latency.)