Skip to content

Instantly share code, notes, and snippets.

@bbbrrriiiaaannn
Created February 23, 2010 01:11
Show Gist options
  • Save bbbrrriiiaaannn/311730 to your computer and use it in GitHub Desktop.
Save bbbrrriiiaaannn/311730 to your computer and use it in GitHub Desktop.
Bookmarklets for CSS authors: these will refresh your CSS without reloading the page.
javascript:(function(){setInterval(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;%20i<a.length;%20i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href){var%20h=s.href.replace(/(&|\?)forceReload\=\d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}},3000)})()
javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href){var%20h=s.href.replace(/(&|\?)forceReload\=\d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment