Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to add jQuery to a framework? Reply To: How to add jQuery to a framework?

#148705
Ed
Participant

There are a number of ways you can add jQuery to your project.

  1. Download it from jquery.com, FTP it to your server, and include it in the <head>, like: <script src="/your/path/to/jquery.js"></script> – this is slower but reliable in that you always know it’ll be there
  2. Use Google’s hosted version which is delivered from a CDN , like: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> – this is faster but it’s not on your server and some devs worry that Google might stop offering this service and if that happens you’re screwed
  3. Combine both, and use Google CDN’s jQuery if it’s available, and fall back to a local copy if it is not – this is really the best of both worlds.