Skip to content

Instantly share code, notes, and snippets.

@Cojad
Created August 18, 2017 09:35
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 Cojad/3c362bfc37c2930f63f24ec0c2133590 to your computer and use it in GitHub Desktop.
Save Cojad/3c362bfc37c2930f63f24ec0c2133590 to your computer and use it in GitHub Desktop.
load jQuery via bookmark
javascript: (window.jQuery) ? console.log('jQuery '+jQuery.fn.jquery+' already loaded!') : (function(e, s) {
e.src = s;e.onload = function() {/*jQuery.noConflict();*/
console.log('jQuery '+jQuery.fn.jquery+' injected');
};
document.head.appendChild(e);
})(document.createElement('script'), 'http://code.jquery.com/jquery-2.2.4.min.js');
jQuery("<h1>test</h1>").attr("style","position:fixed;z-index:9999;width:100%;background-color:rgba(0,255,0,.5);text-align:center").appendTo(document.body).fadeOut( 1500 ).queue(function() { jQuery(this).remove(); });
@Cojad
Copy link
Author

Cojad commented Aug 18, 2017

one line bookmark

javascript: (window.jQuery) ? console.log('jQuery '+jQuery.fn.jquery+' already loaded!') : (function(e, s) {e.src = s;e.onload = function() {/*jQuery.noConflict();*/console.log('jQuery '+jQuery.fn.jquery+' injected');};document.head.appendChild(e);})(document.createElement('script'), '//code.jquery.com/jquery-2.2.4.min.js');jQuery("<h1>jQuery "+jQuery.fn.jquery+" loaded.</h1>").attr("style","position:fixed;z-index:9999;width:100%;top:0;background-color:rgba(0,255,0,1);text-align:center").appendTo(document.body).fadeOut( 3000 ).queue(function() { jQuery(this).remove(); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment