Skip to content

Instantly share code, notes, and snippets.

@jqr
Forked from bkeepers/gist:223062
Created October 31, 2009 15:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jqr/223107 to your computer and use it in GitHub Desktop.
Save jqr/223107 to your computer and use it in GitHub Desktop.
// 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) {
$('link').each(function() {
if((/stylesheet/i).test(this.rel) && this.href) {
var href = this.href.replace(/(&|\?)forceReload=\d+/,'');
this.href = href + ((/\?/).test(href) ? '&' : '?' ) + 'forceReload=' + new Date;
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment