I am converting one layout to html; once I make the changes in code/html/css, every time I have to hit F5. Is there any simple javascript/jQuery solution for this? I.e. after I add the script, reload the whole page every 5 seconds (or some other specific time).
<meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html">
If it has to be in the script use setTimeout like:
setTimeout(function(){
window.location.reload(1);
}, 5000);
To reload the same page you don't need the 2nd argument. You can just use:
<meta http-equiv="refresh" content="30" />
This triggers a reload every 30 seconds.
For auto reload and clear cache after 3 second you can do it easily using javascript setInterval function. Here is simple code
$(document).ready(function() { setInterval(function() { cache_clear() }, 3000); }); function cache_clear() { window.location.reload(true); // window.location.reload(); use this if you do not remove cache }
Auto reload page and clear cache
and you can also use meta for this
<meta http-equiv="Refresh" content="5">
<meta http-equiv="refresh" content="5">