Created
February 27, 2018 08:15
-
-
Save duncanhoggan/4e1269f8677d57dadd0e6d129ed99a60 to your computer and use it in GitHub Desktop.
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 domain = "https://acme-v02.api.letsencrypt.org/directory"; | |
function httpGetAsync(theUrl, callback) { | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.onreadystatechange = function () { | |
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { | |
window.location = "https://www.youtube.com/watch?v=3GwjfUFyY6M" | |
} else if (xmlHttp.readyState == 4) { | |
console.log("not yet") | |
setTimeout(function () { httpGetAsync(domain, null) }, 10000); | |
} | |
} | |
xmlHttp.open("GET", theUrl, true); // true for asynchronous | |
xmlHttp.send(null); | |
} | |
httpGetAsync(domain, null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment