123GoToAndPlay
Aug 9th 2007, 1:22 am
function output(http_request,layerName) {
//Check to see if the XmlHttpRequests state is finished.
if (http_request.readyState == 4) {
//Set the contents of our span element to the result of the asyncronous call.
if (http_request.status == 200) {
document.getElementById(layerName).innerHTML = http_request.responseText;
} else if((http_request.readyState == 1) ||(http_request.readyState == 2)){
document.getElementById(layerName).innerHTML = "loading...<img src=\"loading.gif\"/>";
} else {
document.getElementById(layerName).innerHTML = "Sorry, currently unavailable";
}
}
}
I am loading a file with a big image. I can see the image, but not the loading.gif and loading text
<span id="test" onclick="makeRequest('bigimg.php','test')">
show biggie
</span>
Which readystate do i need to check to show the loading.gif????
//Check to see if the XmlHttpRequests state is finished.
if (http_request.readyState == 4) {
//Set the contents of our span element to the result of the asyncronous call.
if (http_request.status == 200) {
document.getElementById(layerName).innerHTML = http_request.responseText;
} else if((http_request.readyState == 1) ||(http_request.readyState == 2)){
document.getElementById(layerName).innerHTML = "loading...<img src=\"loading.gif\"/>";
} else {
document.getElementById(layerName).innerHTML = "Sorry, currently unavailable";
}
}
}
I am loading a file with a big image. I can see the image, but not the loading.gif and loading text
<span id="test" onclick="makeRequest('bigimg.php','test')">
show biggie
</span>
Which readystate do i need to check to show the loading.gif????