Letting Google host jQuery for you

Include this:

<script src=”//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js” ></script>

and implement like this:


  $(document).ready(function() {

     alert(“let’s go…”);



For example:

$( “.replace_with_element_classname_clicked” ).on( “click”, function( event ) {




  • You’re using the Google APIs CDN which means decreased latency 
  • Increased parallelism (your browser typically limits you to 2 connections per hostname)
  • Better caching (many users will already have cached this library) 

Wonder why the src is missing http:?

This is a handy trick to use a single reference for both http and https pages.

Leave a Reply

Your email address will not be published. Required fields are marked *