I found a chat system on the internet and I'm trying to unravel the code of it, I would like to know how to take the time of the next update of the message box. Here is a snippet of code:
//initiates the first data query
function receiveChatText() {
if (httpReceiveChat.readyState == 4 || httpReceiveChat.readyState == 0) {
httpReceiveChat.open("GET",GetChaturl + '&lastID=' + lastID, true);
httpReceiveChat.onreadystatechange = handlehHttpReceiveChat;
httpReceiveChat.send(null);
}
}
//deals with the servers' reply to requesting new content
function handlehHttpReceiveChat() {
if (httpReceiveChat.readyState == 4) {
var results = document.getElementById("outputList");
results.innerHTML = httpReceiveChat.responseText;
setTimeout('receiveChatText();',60000); //executes the next data query in 4 seconds
}
}
In case I would like to take the time that is missing from this setTimeout if possible, I have already researched and failed.