Skip to content

Instantly share code, notes, and snippets.

@riix
Last active December 11, 2015 12:29
Show Gist options
  • Save riix/4601266 to your computer and use it in GitHub Desktop.
Save riix/4601266 to your computer and use it in GitHub Desktop.
Get Cache Buster Using Time Stamp
var timeStamp = new Date().getTime();
document.write('<script type="text/javascript" src="../js/ui.js?timeStamp='+timeStamp+'" charset="utf-8"><\/script>');
// or
document.write('<script type="text/javascript" src="../js/ui.js?timeStamp='+Math.floor(+new Date()/1000)+'" charset="utf-8"><\/script>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment