Advertisement
KubiPL

[JS] Image cache refresh auto

Nov 19th, 2015
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <script>          
  5.             window.addEventListener("load", onLoad, false);
  6.             function onLoad()
  7.             {
  8.                 var id = document.getElementById("img_cache_refresh");
  9.                 id.src = "img/temp.png?" + new Date().getTime();
  10.             }
  11.         </script>
  12.     </head>
  13.     <body>
  14.         <img src="img/temp.png" id="img_cache_refresh" />
  15.     </body>
  16. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement