0

Do I have to download the jQuery file from jQuery and put it on my server if I use the Google CDN code in my header? Is it one or the other?

Also, I know that jQuery gets updated. When jQuery gets updated, do I have to go to my older webpages and update the code, or just focus on adding the updated code to new webpages?

codermike
  • 1
  • 1
  • You shouldn't worry about jQuery updates. I don't know how often they happen but unless it's a huge update, all the functionality you could ever want is already there. – Eric Guan Mar 16 '16 at 03:01
  • See: [Where do you include the jQuery library from? Google JSAPI? CDN?](http://stackoverflow.com/q/547384) –  Mar 16 '16 at 03:51

1 Answers1

0

No, you don't need both. The CDN is a link to the code and serves the same purpose as downloading the file to your server and using a local link. If you use the CDN, the drawback is response time. In many cases, it's faster to load a local file than a CDN.

If you want to use a newer version, you'll need to change your CDN link or your local file. However, you should test before changing JQuery version in production to ensure nothing breaks.

devlin carnate
  • 8,309
  • 7
  • 48
  • 82