-
-
Save kswedberg/222658 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// easy refresh-css keybinding to alt-w | |
// alt-r was taken in IE, so consider this a CSS Weefresh | |
// original code from http://paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/ | |
$(document).keyup(function(e){ | |
if ( e.which == 87 && e.altKey){ | |
var h=0,a=document.getElementsByTagName('link'),l=a.length,f; | |
for(;h<l;h++){ | |
f=a[h]; | |
if((/stylesheet/i).test(f.rel)&&f.href){ | |
var g=f.href.replace(/(&|\?)forceReload=\d+/,''); | |
f.href=g+((/\?/).test(g)?'&':'?')+'forceReload='+new Date; | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment