Skip to content

Instantly share code, notes, and snippets.

@nckg
Forked from tmcls/UpdateCSS.js
Created August 24, 2012 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nckg/3450457 to your computer and use it in GitHub Desktop.
Save nckg/3450457 to your computer and use it in GitHub Desktop.
Run this jQuery script to update your css. Be creative and create a bookmarklet from it ;-)
$("link[rel=stylesheet]").each(function(){
var url = $(this).attr('href');
url = url.replace(/\?tcnc=\d+/,'').replace(/\&tcnc=\d+/,'');
url += (url.indexOf('?')>0 ? '&' : '?') + 'tcnc=' + (new Date()).getTime();
$(this).attr('href', url);
console.log('[UPDATED CSS] '+ url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment