Skip to content

Instantly share code, notes, and snippets.

@sebnilsson
Created February 7, 2012 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebnilsson/1759713 to your computer and use it in GitHub Desktop.
Save sebnilsson/1759713 to your computer and use it in GitHub Desktop.
Load jQuery async
// Load jQuery
(function () {
var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = true;
jq.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jq, s);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment