Skip to content

Instantly share code, notes, and snippets.

View ctbarna's full-sized avatar

Chris Barna ctbarna

View GitHub Profile
@ctbarna
ctbarna / conditionally-load-jquery.js
Created April 13, 2011 18:22 — forked from benbalter/conditionally-load-jquery.js
Conditionally load jQuery (with slight version independence). Not expecting the API to change a whole lot in the sub-versions.
//Conditionally load jQuery
//inspired by http://www.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/
window.onload = function () {
if (typeof jQuery == 'undefined') {
var jQ = document.createElement('script');
jQ.type = 'text/javascript';
jQ.onload = jQ.onreadystatechange = myOnLoadEvent;
jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js';
document.body.appendChild(jQ);
@ctbarna
ctbarna / 0_reuse_code.js
Created January 14, 2016 19:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console