Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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