Skip to content

Instantly share code, notes, and snippets.

@thousandlemons
Created October 27, 2018 03:06
Show Gist options
  • Save thousandlemons/a7436693d7f9ceb393279f6d843533cf to your computer and use it in GitHub Desktop.
Save thousandlemons/a7436693d7f9ceb393279f6d843533cf to your computer and use it in GitHub Desktop.
load jquery
// Anonymous "self-invoking" function
(function() {
// Load the script
var script = document.createElement("SCRIPT");
script.src = 'https://code.jquery.com/jquery-3.3.1.min.js';
script.type = 'text/javascript';
script.onload = function() {
var $ = window.jQuery;
// Use $ here...
};
console.log(script);
document.getElementsByTagName("head")[0].appendChild(script);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment