Skip to content

Instantly share code, notes, and snippets.

@gfpaiva
Forked from DouglasAmarelo/CSSForceUpdate.js
Last active April 4, 2017 15:06
Show Gist options
  • Select an option

  • Save gfpaiva/83d84c93bca651f910bf772eed788a4a to your computer and use it in GitHub Desktop.

Select an option

Save gfpaiva/83d84c93bca651f910bf772eed788a4a to your computer and use it in GitHub Desktop.
(function(){
var loja = window.jsnomeLoja,
css = $('link[href*="' + loja + '2-style.css"]'),
cssHref = css.attr('href'),
cssVersion = 1;
if( cssHref.indexOf('?v=') >= 0 ){
cssVersion = parseInt(cssHref.match(/v=\d+/)[0].replace('v=',''));
cssVersion++;
cssHref = cssHref.split('?')[0];
}
css.attr('href', cssHref + '?v=' + cssVersion);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment