L
libsfan01
Hi all
How can i modify my code so that js will continously check the data on
a page (data.php) and bring it through. at the moment it only does it
once when the function is called, how can i modify my code to allow for
continous looping?
function getdata() {
get = new XMLHttpRequest();
get.onreadystatechange = processdata;
get.open("GET", "data.php");
get.send(null);
}
function processdata() {
if (get.readyState == 4) {
data = get.responseText;
document.getElementById("display").value = data;
}
}
How can i modify my code so that js will continously check the data on
a page (data.php) and bring it through. at the moment it only does it
once when the function is called, how can i modify my code to allow for
continous looping?
function getdata() {
get = new XMLHttpRequest();
get.onreadystatechange = processdata;
get.open("GET", "data.php");
get.send(null);
}
function processdata() {
if (get.readyState == 4) {
data = get.responseText;
document.getElementById("display").value = data;
}
}