Greetings! I'm currently working on an XMHHttp request, but the website's load time is causing me to only reach ReadyState = 3 and Status = 200. In order to proceed, I need a solution that will wait until ReadyState = 4, but with the added requirement of limiting this check to occur once every second; otherwise, do nothing.
Could you provide guidance on what such a delay function would look like?
if (xmlhttp.readyState==4 && xmlhttp.status==200)//Insert the delay mechanism here to prevent triggering the else condition
{
var txt=xmlhttp.responseText;
.....
else {
document.write("Status: " + xmlhttp.readyState + " " + xmlhttp.status);
}