How to add jQuery to your site

By Andreas Blixt. Updated 2 years, 10 months ago. 18,205 unique views.

There are several ways of adding jQuery to your site.

Use Google's servers

Google actually hosts jQuery on their servers and let you fetch it from them, no strings attached. The benefits of getting it from Google's servers are several. More about them later.

Including jQuery from Google's servers is very easy. We recommend that you include it in the bottom of the page, because this will make your page load faster. Open the HTML for your site and locate the end of the page body (</body>). Put the following just before the </body> tag:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"
type="text/javascript"></script>

This will get the latest bug-fix release of jQuery 1.5 (as of this writing 1.5.2). You can also get, for example, version 1.3.2 by changing 1.5 in the URL above to 1.3.2.

Alright, you're all good to go!

Why should I use Google's servers?

  • Many web browsers will limit the number of downloads per domain. Since you're getting jQuery from another domain, that's one more file that can be downloaded simultaneously.
  • Since a lot of other sites use the same method, your visitors may already have downloaded jQuery from Google once. This means that jQuery is cached on their computer and no download will be required.
  • The file is on a so-called CDN (Content Delivery Network), which means that the file is spread across a lot of servers around the world, and the server closest to your visitor will be chosen for the download. This results in less time waiting for the download to start.
  • Depending on how you include the file, you can get Google to provide you with the latest bug-fix version of jQuery, so you don't have to update it yourself.

Host the file yourself

You can also host the file yourself. You can download the latest version of jQuery from their site. Make sure you choose the Production version. This version is much smaller and will make your site load faster. If the file opens in your browser instead of being downloaded, just right click somewhere on the page and choose Save As… or select File and then Save As…. Put the file with your other web site files.

All you need to do now is to include jQuery on your site. It's the same procedure as for including the script from Google, but a different path. Put the following before the </body> tag:

<script src="jquery-1.5.2.min.js" type="text/javascript"></script>

Note that you may have downloaded a later version of jQuery, so make sure that the filename is the same as what you put in the src attribute.

Comments (50)

TashaFischer32: (2 years, 4 months ago)
Every body understands that humen's life is expensive, but people need money for different things and not every person gets enough money. Thence to get some <a href="http://goodfinance-blog.com/topics/business-loans">business loans</a> and just small business loan will be good way out.

wherewhere: (2 years ago)
<br><strong><a href="http://www.monclersalecoats.org/moncler-coats-moncler-classic-quincy-black-puffer-down-jacket-mc30044-p-3081.html">Moncler Menuire Down Jacket in White MC10062</a></strong>

blackevening: (2 years ago)
<br><strong><a href="http://www.watchclones.com/">Replica watches</a></strong><br><strong><a href="http://www.watchclones.com/">Fake watches</a></strong>

gluelesswig: (2 years ago)
<br><strong><a href="http://www.watchclones.com/">Replica watches</a></strong><br><strong><a href="http://www.watchclones.com/">Fake watches</a></strong>

wherewhere: (1 year, 12 months ago)
<br><strong><a href="http://www.orbto.com/">software outsourcing</a></strong><br><strong><a href="http://www.orbto.com/">business process outsourcing</a></strong><br><strong><a href="http://www.orbto.com/">software outsourcing service</a></strong>

northgore: (1 year, 12 months ago)
<strong><a href="http://www.egrich.com/TERA/gold/8183">tera gold</a></strong><br><strong><a href="http://www.egrich.com/TERA/gold/8183">buy tera gold</a></strong><strong><a href="http://www.egrich.com/TERA/gold/8183">cheap tera gold</a></strong>

northgore: (1 year, 11 months ago)
<strong><a href="http://www.aeveningdresses.com/">Wholesale Wedding Dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">Bridal dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">bridal gown</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">cheap Bridal dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">buy Bridal dresses</a></strong><br>

buyaccessories: (1 year, 11 months ago)
<br><strong><a href="http://www.watchclones.com/">Replica watches</a></strong><br><strong><a href="http://www.watchclones.com/">Fake watches</a></strong>

northgore: (1 year, 11 months ago)
<strong><a href="http://www.aeveningdresses.com/">Wholesale Wedding Dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">Bridal dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">bridal gown</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">cheap Bridal dresses</a></strong><br>
<strong><a href="http://www.aeveningdresses.com/bridal-c-1.html">buy Bridal dresses</a></strong><br>

cheapbelstaff: (1 year, 10 months ago)
<strong><a href="http://www.apromdresses.com/">Custom Wedding Dresses</a></strong><br>
<strong><a href="http://www.apromdresses.com/bridal-c-1.html">Bridal</a></strong><br>
<strong><a href="http://www.apromdresses.com/bridal-c-1.html">Bridal dresses</a></strong><br>
<strong><a href="http://www.apromdresses.com/bridal-c-1.html">bridal gown</a></strong><br>
<strong><a href="http://www.apromdresses.com/bridal-c-1.html">cheap Bridal dresses</a></strong><br>

cheapbelstaff: (1 year, 10 months ago)
<br><strong><a href="http://www.orbto.com/">software outsourcing</a></strong><br><strong><a href="http://www.orbto.com/">business process outsourcing</a></strong><br><strong><a href="http://www.orbto.com/">software outsourcing service</a></strong>

wherewhere: (1 year, 9 months ago)
<br><strong><a href="http://www.weddingdressspace.com/ ">Wedding Dresses</a></strong><strong><a href="http://www.weddingdressspace.com/ ">Prom Dresses</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">evening dresses</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">wedding gowns</a></strong><strong><a href="http://www.weddingdressspace.com/ ">Bridesmaids Dresses</a></strong>

cheapbelstaff: (1 year, 8 months ago)
<br><strong><a href="http://www.fastdresses.com/ ">wedding dresses</a></strong>

northgore: (1 year, 7 months ago)
<strong><a href="http://www.paydollar.com.cn/ecommerce.htm "></a></strong><br>
<strong><a href="http://www.paydollar.com.cn/ecommerce.htm ">ƽ̨</a></strong><br>
<strong><a href="http://www.paydollar.com.cn/schdule.htm "></a></strong><br>
<strong><a href="http://www.paydollar.com.cn/schdule.htm ">a></strong><br>
<strong><a href="http://www.paydollar.com.cn/schdule.htm ">óa></strong><br>

discountoutlet: (1 year, 6 months ago)
<br><strong><a href="http://www.dresseveingdresses.com/ ">Dress</a></strong><br><strong><a href="http://www.dresseveingdresses.com/ ">evening dresses</a></strong><br><strong><a href="http://www.dresseveingdresses.com/ ">cheap evening dress</a></strong><br><strong><a href="http://www.dresseveingdresses.com/ ">evening gowns</a></strong><br><strong><a href="http://www.dresseveingdresses.com/ ">Bridesmaid Dresses</a></strong>

northgore: (1 year, 6 months ago)
<br><strong><a href="http://www.weddingdressspace.com/ ">Wedding Dresses</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">Prom Dresses</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">evening dresses</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">wedding gowns</a></strong><br><strong><a href="http://www.weddingdressspace.com/ ">Bridesmaids Dresses</a></strong>

wherewhere: (1 year, 6 months ago)
<br><strong><a href="http://www.ecigarettebank.com/ ">Mini E-cigarette</a></strong><br><strong><a href="http://www.ecigarettebank.com/ ">Electronic Cigarette sale</a></strong><br><strong><a href="http://www.ecigarettebank.com/ ">e-cigarette</a></strong><br><strong><a href="http://www.ecigarettebank.com/ ">discount Electronic Cigarette</a></strong>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://www.dresschoose.com/es/">Prom Dresses</a></strong><br><strong><a href="http://www.dresschoose.com/es/">Quinceanera Dresses</a></strong><strong><a href="http://www.dresschoose.com/es/">Celebrity Dresses</a></strong><br><strong><a href="http://www.dresschoose.com/es/">Evening Dresses</a></strong><strong><a href="http://www.dresschoose.com/es/">Vestidos fiesta</a></strong>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://www.ourtiffany.com/es/joyería-c-46.html">Joyería</a></strong><br><strong><a href="http://www.ourtiffany.com/es/joyería-c-46.html">Tiffany Joyería</a></strong><br><strong><a href="http://www.ourtiffany.com/es/joyería-c-46.html">Barato Joyería Tiffany</a></strong><br><strong><a href="http://www.ourtiffany.com/es/joyería-c-46.html">Venta de joyas Tiffany</a></strong><br><strong><a href="http://www.ourtiffany.com/es/joyería-pulseras-c-46_58.html">Pulseras</a></strong>

discountoutlet: (1 year, 5 months ago)
<strong><a href="http://www.anotherbikini.com/es/">bikinis</a></strong><br>
<strong><a href="http://www.anotherbikini.com/es/">bikinis online</a></strong><br>
<strong><a href="http://www.anotherbikini.com/es/">comprar bikinis</a></strong><br>
<strong><a href="http://www.anotherbikini.com/es/sexy-bikini-c-522.html">descuento Sexy Bikini</a></strong><br>
<strong><a href="http://www.anotherbikini.com/es/sexy-bikini-c-522.html">Bikini Sexy barato</a></strong><br>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.hellopromdress.com/">wedding dresses online</a></strong><br><strong><a href="http://www.hellopromdress.com/es/">wedding dresses online</a></strong><br><strong><a href="http://es.hellopromdress.com/">prom dresses</a></strong><br><strong><a href="http://es.hellopromdress.com/">white wedding dresses</a></strong><strong><a href="http://www.hellopromdress.com/es/">white wedding dresses</a></strong><br><br><br><br><br>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.havesunglasses.com/">Sunglasses sale</a></strong><strong><a href="http://www.havesunglasses.com/es/">Cheap Sunglasses</a></strong><br><strong><a href="http://es.havesunglasses.com/">Sunglasses Outlet</a></strong><strong><a href="http://www.havesunglasses.com/es/">Sunglasses on sale</a></strong><strong><a href="http://es.havesunglasses.com/">Police Sunglasses</a></strong><br><br>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.kissglasses.com/gafas-de-sol-oakley-c-108.html"></a></strong><strong><a href="http://es.kissglasses.com/gafas-de-sol-oakley-c-108.html"></a></strong><br><strong><a href="http://es.kissglasses.com/gafas-de-sol-oakley-c-108.html"></a></strong><strong><a href="http://es.kissglasses.com/gafas-de-sol-oakley-c-108.html"></a></strong><br><strong><a href="http://es.kissglasses.com/gafas-de-sol-oakley-gafas-de-sol-oakley-activos-c-108_112.html"></a></strong>

discountoutlet: (1 year, 5 months ago)
<strong><a href="http://www.replicanewwatches.com/es/">relojes a la venta</a></strong><br>
<strong><a href="http://es.replicanewwatches.com/">Logines relojes</a></strong><br>
<strong><a href="http://www.replicanewwatches.com/es/">Logines relojes</a></strong><br>
<strong><a href="http://www.replicanewwatches.com/es/">relojes baratos</a></strong><br>
<strong><a href="http://es.replicanewwatches.com/">comprar relojes</a></strong><br>

discountoutlet: (1 year, 5 months ago)
Links Of London 3D H Charm [1015] - &euro;24.75 : TITLE, SITE_TAGLINE

wherewhere: (1 year, 5 months ago)
<strong><a href="http://www.cheapestlinksoflondon.com/">Links Of London</a></strong><strong><a href="http://www.cheapestlinksoflondon.com/">cheap Links Of London</a></strong><strong><a href="http://www.cheapestlinksoflondon.com/">buy Links Of London</a></strong><br><strong><a href="http://www.cheapestlinksoflondon.com/">discount Links Of London</a></strong><strong><a href="http://www.cheapestlinksoflondon.com/">Links Of London stroe</a></strong><br>

wherewhere: (1 year, 5 months ago)
<br><strong><a href="http://www.watchpopular.com/">Longines Watches</a></strong><br><strong><a href="http://www.watchpopular.com/">Montblanc Watches</a></strong><strong><a href="http://www.watchpopular.com/">Omega Watches</a></strong><br><strong><a href="http://www.watchpopular.com/">ORIS Watches</a></strong><strong><a href="http://www.watchpopular.com/">Panerai Watches</a></strong><br><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
<br><strong><a href="http://nl.watchesparty.org/">replica horloges te koop</a></strong><strong><a href="http://nl.watchesparty.org/">replica horloges</a></strong><br><strong><a href="http://nl.watchesparty.org/">nep-horloges</a></strong><br><strong><a href="http://nl.watchesparty.org/">nep Omega horloges</a></strong><strong><a href="http://nl.watchesparty.org/audemars-piguet-horloges-c-1.html">Replica Audemars Piguet horloges</a></strong><br><br><br>

northgore: (1 year, 5 months ago)
<br><strong><a href="http://www.swisswatchestime.com/">cheap watches</a></strong><br><strong><a href="http://www.swisswatchestime.com/">copy wacthes</a></strong><br><strong><a href="http://www.swisswatchestime.com/">fake wacthes</a></strong><strong><a href="http://www.swisswatchestime.com/">discount wacthes</a></strong><strong><a href="http://www.swisswatchestime.com/">buy wacthes</a></strong><br><br>

cheapbelstaff: (1 year, 5 months ago)
SEO Services

northgore: (1 year, 5 months ago)
<br><strong><a href="http://www.bookpromdress.com/">Wedding Dresses</a></strong><strong><a href="http://www.bookpromdress.com/">Wedding Gowns</a></strong><br><strong><a href="http://www.bookpromdress.com/">Evening Dresses</a></strong><strong><a href="http://www.bookpromdress.com/">Bridesmaid Gowns</a></strong><strong><a href="http://www.bookpromdress.com/">Cheap Dresses</a></strong><br><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
<br><strong><a href="http://nl.anotherbikini.com/">korting zwempakken</a></strong><br><strong><a href="http://nl.anotherbikini.com/">bikini's</a></strong><br><strong><a href="http://nl.anotherbikini.com/">bikini's online</a></strong><br><strong><a href="http://nl.anotherbikini.com/">kopen bikini's</a></strong><br><strong><a href="http://nl.anotherbikini.com/">bikini badpak</a></strong><br><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
<br><strong><a href="http://www.mrstiffany.com/nl/jewelry-c-46.html">Juwelen</a></strong><strong><a href="http://www.mrstiffany.com/nl/jewelry-c-46.html">Tiffany sieraden</a></strong><br><strong><a href="http://www.mrstiffany.com/nl/jewelry-c-46.html">Goedkope Tiffany sieraden</a></strong><strong><a href="http://www.mrstiffany.com/nl/jewelry-c-46.html">Tiffany sieraden</a></strong><strong><a href="http://www.mrstiffany.com/nl/jewelry-c-46.html">Tiffany sieraden te koop</a></strong><br>

northgore: (1 year, 5 months ago)
<strong><a href="http://www.beginroom.com/">Designer Cushions</a></strong><br>
<strong><a href="http://www.beginroom.com/bedding-sets-c-69.html">Bedding Sets</a></strong><br>
<strong><a href="http://www.beginroom.com/bedding-sets-c-69.html">Cheap Bedding Sets</a></strong><br>
<strong><a href="http://www.beginroom.com/bedding-sets-c-69.html">Cheap Bedding</a></strong><br>
<strong><a href="http://www.beginroom.com/bedding-sets-c-69.html">Luxury Bedding</a></strong><br>

cheapbelstaff: (1 year, 5 months ago)
<br><strong><a href="http://nl.allnewwatches.com/">new watches</a></strong><br><strong><a href="http://www.allnewwatches.com/nl/">new watches</a></strong><strong><a href="http://nl.allnewwatches.com/">discount watches</a></strong><strong><a href="http://www.allnewwatches.com/nl/">discount watches</a></strong><strong><a href="http://nl.allnewwatches.com/">replica watches</a></strong><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
golfclubs, Callaway Golf, golf strijkijzers, hout golfclubs, golfclubs junior, ping golf clubs, golf wedges, ijzers golfclubs

cheapbelstaff: (1 year, 5 months ago)
<strong><a href="http://nl.watchplease.com/">gucci watches</a></strong><br><strong><a href="http://www.watchplease.com/nl/">rado watches</a></strong><strong><a href="http://nl.watchplease.com/">tag heuer watches</a></strong><strong><a href="http://www.watchplease.com/nl/">tag heuer watches</a></strong><strong><a href="http://nl.watchplease.com/">buy watch</a></strong><br><br>

wherewhere: (1 year, 5 months ago)
<br><strong><a href="http://www.choosewatchesonline.com/">Bell & Ross Watches</a></strong><strong><a href="http://www.choosewatchesonline.com/">Blancpain Watches</a></strong><br><strong><a href="http://www.choosewatchesonline.com/">Breguet Watches</a></strong><br><strong><a href="http://www.choosewatchesonline.com/">Breitling Watches</a></strong><strong><a href="http://www.choosewatchesonline.com/">BRM Watches</a></strong><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
<br><strong><a href="http://nl.moonwigs.org/">pruiken</a></strong><strong><a href="http://www.moonwigs.org/nl/">pruiken</a></strong><strong><a href="http://nl.moonwigs.org/">kostuum pruiken</a></strong><br><strong><a href="http://www.moonwigs.org/nl/">kostuum pruiken</a></strong><strong><a href="http://nl.moonwigs.org/">hair extensions</a></strong><br><br><br><br><br>

cheapbelstaff: (1 year, 5 months ago)
<strong><a href="http://nl.anotherbikini.com/">korting zwempakken</a></strong><br>
<strong><a href="http://nl.anotherbikini.com/">bikini's</a></strong><br>
<strong><a href="http://nl.anotherbikini.com/">bikini's online</a></strong><br>
<strong><a href="http://nl.anotherbikini.com/">kopen bikini's</a></strong><br>
<strong><a href="http://nl.anotherbikini.com/sexy-bikini-c-522.html">Sexy Bikini</a></strong><br>

northgore: (1 year, 5 months ago)
<br><strong><a href="http://www.linkreplicawatches.com/">Replica Watches</a></strong><br><strong><a href="http://www.linkreplicawatches.com/">Rolex replica watches</a></strong><strong><a href="http://www.linkreplicawatches.com/">replica B.R.M Watches</a></strong><br><strong><a href="http://www.linkreplicawatches.com/">Replica Cartier Watches</a></strong><strong><a href="http://www.linkreplicawatches.com/">replica HUBLOT watchs</a></strong>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.aglassesonline.com/">gafas online</a></strong><strong><a href="http://www.aglassesonline.com/es/">gafas online</a></strong><strong><a href="http://es.aglassesonline.com/">gafas de sol en línea</a></strong><br><strong><a href="http://www.aglassesonline.com/es/">gafas de sol en línea</a></strong><strong><a href="http://es.aglassesonline.com/">gafas de sol al por mayor</a></strong>

wherewhere: (1 year, 5 months ago)
<br><strong><a href="http://www.semarea.com/">Promodo SEO company</a></strong><br><strong><a href="http://www.semarea.com/"> SEO Services</a></strong><br><strong><a href="http://www.semarea.com/"> SEO marketing services</a></strong><strong><a href="http://www.semarea.com/"> search engine optimization</a></strong><br><strong><a href="http://www.semarea.com/a/SEO_Services/Link_Building/">Website Link Building</a></strong><br>

northgore: (1 year, 5 months ago)
<strong><a href="http://www.allcopywatches.com/">copy watches</a></strong><br><strong><a href="http://www.allcopywatches.com/">replica watches</a></strong><strong><a href="http://www.allcopywatches.com/">fake watches</a></strong><br><strong><a href="http://www.allcopywatches.com/">replica roles watches</a></strong><strong><a href="http://www.allcopywatches.com/">replica cartier watches</a></strong><br><br><br><br><br>

northgore: (1 year, 5 months ago)
<strong><a href="http://www.abridedresses.com/"> Brides Dress</a></strong><br>
<strong><a href="http://www.abridedresses.com/">Prom Dresses</a></strong><br>
<strong><a href="http://www.abridedresses.com/bridal-c-1.html">Bridal dresses</a></strong><br>
<strong><a href="http://www.abridedresses.com/bridal-c-1.html">bridal gown</a></strong><br>
<strong><a href="http://www.abridedresses.com/bridal-c-1.html">cheap Bridal dresses</a></strong><br>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.allcopywatches.com/">relojes copia</a></strong><strong><a href="http://www.allcopywatches.com/es/">relojes copia</a></strong><br><strong><a href="http://es.allcopywatches.com/">réplicas de relojes</a></strong><br><strong><a href="http://www.allcopywatches.com/es/">réplicas de relojes</a></strong><strong><a href="http://es.allcopywatches.com/">relojes falsos</a></strong><br><br>

discountoutlet: (1 year, 5 months ago)
<strong><a href="http://es.havebikini.com/">trajes de baño baratos</a></strong><br><strong><a href="http://www.havebikini.com/es/">trajes de baño baratos</a></strong><br><strong><a href="http://es.havebikini.com/">comprar trajes de baño</a></strong><br><strong><a href="http://www.havebikini.com/es/">comprar trajes de baño</a></strong><br><strong><a href="http://es.havebikini.com/">bikini</a></strong><br><br><br><br><br>

discountoutlet: (1 year, 5 months ago)
<strong><a href="http://www.sellreplicawatches.com/es/">relojes casio</a></strong><strong><a href="http://es.sellreplicawatches.com/">omega relojes</a></strong><strong><a href="http://www.sellreplicawatches.com/es/">relojes venta</a></strong><br><strong><a href="http://es.sellreplicawatches.com/">comprar relojes</a></strong><br><strong><a href="http://www.sellreplicawatches.com/es/">armani relojes</a></strong><br><br>

discountoutlet: (1 year, 5 months ago)
<br><strong><a href="http://es.alllouisvuitton.com/">Louis Vuitton</a></strong><strong><a href="http://www.alllouisvuitton.com/es/">Louis Vuitton</a></strong><strong><a href="http://es.alllouisvuitton.com/">LV Bags Store</a></strong><strong><a href="http://www.alllouisvuitton.com/es/">LV Bags Store</a></strong><strong><a href="http://es.alllouisvuitton.com/">LV Outlet Online</a></strong><br><br><br>

wherewhere: (1 year, 5 months ago)
<br><strong><a href="http://www.okaywedding.com/">bridal gowns</a></strong><strong><a href="http://www.okaywedding.com/">wedding gowns</a></strong><strong><a href="http://www.okaywedding.com/">formal gowns</a></strong><br><strong><a href="http://www.okaywedding.com/">wedding dress</a></strong><strong><a href="http://www.okaywedding.com/">prom dresses</a></strong><br><br><br><br><br>

Login or join SimpleEditions to participate.

Photos of contributors

Your expertise is needed

SimpleEditions is a tutorial community that we create to together.
We gather the experience of thousands of individuals and convert it into high quality, easy to understand tutorials.