S
shankwheat
I'm experimenting with using a AJAX style "processing" icon. The
process I'm running in the background with xmlHttp is intensive and
takes a 5--10 secs to complete. Instead of my processing icon
appearing in the page, the page just freezes during the process until
it's finished. Is this the best way to display this kind of icon?
What can I do so this works right? Thanks
function stateChanged()
{
if (xmlHttp.readyState == 0)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //loading
}
else if(xmlHttp.readyState == 1)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //loaded
}
else if(xmlHttp.readyState == 2)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //interactive
}
else if(xmlHttp.readyState == 3)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>";
}
else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("lblResults").innerHTML = "";
<span id="lblResults" name="lblResults"></span>
process I'm running in the background with xmlHttp is intensive and
takes a 5--10 secs to complete. Instead of my processing icon
appearing in the page, the page just freezes during the process until
it's finished. Is this the best way to display this kind of icon?
What can I do so this works right? Thanks
function stateChanged()
{
if (xmlHttp.readyState == 0)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //loading
}
else if(xmlHttp.readyState == 1)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //loaded
}
else if(xmlHttp.readyState == 2)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>"; //interactive
}
else if(xmlHttp.readyState == 3)
{
document.getElementById("lblResults").innerHTML = "<img
src='mozilla_blu.gif' alt='loading..please wait'>";
}
else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("lblResults").innerHTML = "";
<span id="lblResults" name="lblResults"></span>