When hotlinking to jQuery, should it be linked to Google or the jQuery site?
In th开发者_开发技巧e jQuery download section, there's three major CDN hosts for public use. code.jquery.com being one of them. Did they show up late to the CDN game, which is why Google and Microsoft are listed first? Which of these is better to link to?
I imagine jQuery should be the one you link to since that's where the code originates. Then again, Google has proven to be rather robust.
I always link to Google CDN. The downfall of official way is too many http requests to finally get the script. There is more about it: http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/
And as for linking to the newest version - it's not always the best idea (compability issues).
I always link to code.jquery.com (as do their examples on the official site). This also gives the advantage of being able to link to http://code.jquery.com/jquery-latest.js. Other than that... idk :P
I typically download the most recent .js file that I am working with and serve it up locally. While this will not ensure you have the latest, as Jacek_FH pointed out, it will eliminate any change issues and external requests.
Use Google's ...
Out of Google, MS and jQuery's CDNs, Google loaded quickest, then MS with jQuery (on MediaTemple) a firm last.
[info gathered using simple browser webdev tools]
精彩评论