Created
August 24, 2017 22:21
-
-
Save RayBB/de8954ee5c4af2d8d63c08d469acf12b to your computer and use it in GitHub Desktop.
Automatically updates any page every at whatever
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
var delay = 1; // seconds | |
var update = function(delay) { | |
var request = new XMLHttpRequest(); | |
request.open('GET', window.location.href, true); | |
request.onload = function() { | |
document.body.innerHTML = this.response; | |
setTimeout(() => update(delay), (delay | 1) * 1000); | |
}; | |
request.send(); | |
}; | |
update(delay); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment