Last active
December 19, 2018 06:35
-
-
Save praveenravi/fdd80cba1cd3f37e4d8f to your computer and use it in GitHub Desktop.
Reload a page
This file contains 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 tyep="text/javascript"> | |
$(document).ready(function(){ | |
var time = new Date().getTime(); | |
$(document.body).bind("mousemove keypress", function(e) { | |
time = new Date().getTime(); | |
}); | |
function refresh() { | |
if(new Date().getTime() - time >= 6000) | |
window.location.reload(true); | |
else | |
setTimeout(refresh, 1000); | |
} | |
setTimeout(refresh, 1000); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment