Created
September 6, 2014 01:22
-
-
Save maxicecilia/1159d0548306507b363f to your computer and use it in GitHub Desktop.
Simply script to avoid cache in js/css files using javascript only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="whatever.js"></script> | |
<script type="text/javascript"> | |
(function(s){ | |
s = s[s.length - 2]; | |
s.src = s.src + '?bustcache=' + new Date().getTime(); | |
})(document.getElementsByTagName('script')); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment