Firstly, why link to someone elses jquesy file when you can have a copy of your own?
Then, I used to link to googles file but then read about google being banned in a few countries so they wont be able to have the jquery file surely?
So that leaves? Microsofts link?
OR is it actualy better to link to your own hosted file?
OR is there a best of both? Someway that you can try to link to someone elses and if that doesnt work use your own hosted one?
A number of countries block YouTube and some block StreetView, but the only ones that block Google as a whole as far as I know are China and Vietnam. Do you get a lot of pageviews from China and Vietnam? Then just load jq from your js folder, no biggie.
This reply has been reported for inappropriate content.
I think it’s best to link to either Google’s or Microsoft’s CDN simply because so many others do and the library will likely already be cached. Then as a fallback link to a local copy if the first failed:
I would agree with wolf 110%. If you had the file on your own server, other people would have to redownload it from you while they most likely already had it cached from google. So basically it would be pointless and second, less space taken up although its quite small.
I agree it’s best to use a CDN. I had no idea china had banned Google, thats kind of stupid I think. Although I guess it could be because of googles Cacheing of sites, not sure if that would allow chinese people to get around the firewall that the government has up or not.
so yeah, do use a CDN, and if you get large amounts of traffic from china take wolf’s advice and use a local copy as a fallback solution.
Personally, i say go with someone reliable who is already hosting it, like Google. You have a better chance of hitting a cached browser with that jQuery and if they don’t have it ( or the country had blocked it ) than just load a local version like wolfcry911 said.
Maybe some analytics system on your site to find your target audience with geo-location would help.
Most, if not all scripts will register some kind of variable/object/function to the window to check against, jQuery registers jQuery and the $ shortcut, jQuery UI registers jQuery.ui and that script you posted as an example registers a variable named $bu, so in your case the cdn vs local check would be
Where you also store a local copy in a folder named "js"