Joe
Joe

Reputation: 16831

When hotlinking to jQuery, should it be linked to Google or the jQuery site?

In the 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.

Upvotes: 2

Views: 273

Answers (4)

devolved
devolved

Reputation: 98

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]

Upvotes: 0

ckaufman
ckaufman

Reputation: 1497

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.

Upvotes: 0

Jacek Kaniuk
Jacek Kaniuk

Reputation: 5229

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).

Upvotes: 6

Joseph Marikle
Joseph Marikle

Reputation: 78520

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

Upvotes: 2

Related Questions