My site downloads a rather large js file the first time a user visits it, and I want to write something like "Downloading .. for the first time", this file is not from the cache.
Is this possible in javascript?
in js
var loadedMyJS = true
in your html
<script > function loadingIndicator(){ document.getElementById('loadingDiv').style.display=''; //to hideit will be 'none' } if(typeof(loadedMyJS) == 'undefined'){ loadingIndicator(); } </script >
How about including a dynamic timestamp at the end and checking it after?
var t=<?php echo time(); ?>;
At least I would have been instructed after this fact. Or would I mess up other caching mechanisms by updating the file?