Skip to content

Instantly share code, notes, and snippets.

View qwertypants's full-sized avatar
🧶

Wilkins Fernandez qwertypants

🧶
View GitHub Profile
@qwertypants
qwertypants / jQueryLint.js
Created January 11, 2011 20:13 — forked from buzzedword/jQueryLint.js
jQuery lint bookmarklet
javascript:(function(){(function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0];otherlib=false,msg='';el.style.position='fixed';el.style.height='32px';el.style.width='220px';el.style.marginLeft='-110px';el.style.top='0';el.style.left='50%';el.style.padding='5px 10px 5px 10px';el.style.zIndex=1001;el.style.fontSize='12px';el.style.color='#222';el.style.backgroundColor='#f99';function getLint(url){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;}};head.appendChild(script);}function getScript(url,success){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=
@qwertypants
qwertypants / gist:766732
Created January 5, 2011 18:29 — forked from getify/gist:670840
Load a local copy of jQuery if a CDN is not available
function test_jQuery() { jQuery(""); }
function success_jQuery() { alert("jQuery is loaded!");
var successfully_loaded = false;
function loadOrFallback(scripts,idx) {
function testAndFallback() {
clearTimeout(fallback_timeout);
if (successfully_loaded) return; // already loaded successfully, so just bail
try {
scripts[idx].test();