Skip to content

Instantly share code, notes, and snippets.

@jney
Forked from mikelikespie/refresh_css.js
Created October 28, 2010 21:29
Show Gist options
  • Save jney/652374 to your computer and use it in GitHub Desktop.
Save jney/652374 to your computer and use it in GitHub Desktop.
/*
Add a bookmark to this
javascript:(function(b){for(var c=0,a=b.length;c<a;c++){var d=b[c];if(d.rel==="stylesheet"||d.type==="text/css"){var e=d.href.split("?",2);d.href=e[0]+"?"+((e.length===2)?e[1]+"&":"")+(new Date().getTime())}}})(document.getElementsByTagName("link"));
*/
;(function (links) {
for (var i = 0, len = links.length; i < len; i++) {
var link = links[i];
if (link.rel === 'stylesheet' || link.type === 'text/css') {
var splitted = link.href.split('?', 2);
link.href = splitted[0] + '?'
+ ((splitted.length === 2) ? splitted[1] + '&' : '')
+ (new Date().getTime());
}
}
})(document.getElementsByTagName('link'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment