N
nikki.farrah
Hi all, this is my first time posting so any help is appreciated! I
am doing a simple AJAX request to our server, and I would like the
cursor style changed to 'wait' when the user clicks a button which
calls the function below. After the request is complete, I would like
the style changed back. For some reason, it doesn't change the cursor
style until after the request is made, even though it's the first line
I put in the function. I tried putting it in a seperate function and
calling that in this function and in the onclick even handler, I tried
taking out the AJAX request and it works fine, etc. I know it does it
after the request because when I comment out the line setting it back
to 'auto' so it will change to 'wait' the entire time, it doesn't do
so until after the request is completed. I researched and did not find
any other users experiencing the same problem, but hopefully someone
can shed some light on the situation. Here is the function after I
deleted out the irrelevent parts. Thanks in advance!
function qaResults(){
document.body.style.cursor='wait';
***code here to find dbname and query1****
var d = new Date();
recReq = new ActiveXObject("Microsoft.XMLHTTP");
recReq.open("get", "ProduceTable.aspx?choice=queryResults&query=" +
query1 + "&dbname=" + dbname + "&timer=" + d.getTime(), false);
recReq.send();
if (recReq.readyState == 4)
{
if (recReq.status == 200)
{
document.getElementById('ResultsTable').innerHTML =
recReq.responseText;
document.getElementById('ResultsTable').style.height = "200px";
sortables_init();
}
else
alert("There was a problem retrieving HTML table:\n" +
recReq.statusText);
}
document.body.style.cursor = 'auto';
}
am doing a simple AJAX request to our server, and I would like the
cursor style changed to 'wait' when the user clicks a button which
calls the function below. After the request is complete, I would like
the style changed back. For some reason, it doesn't change the cursor
style until after the request is made, even though it's the first line
I put in the function. I tried putting it in a seperate function and
calling that in this function and in the onclick even handler, I tried
taking out the AJAX request and it works fine, etc. I know it does it
after the request because when I comment out the line setting it back
to 'auto' so it will change to 'wait' the entire time, it doesn't do
so until after the request is completed. I researched and did not find
any other users experiencing the same problem, but hopefully someone
can shed some light on the situation. Here is the function after I
deleted out the irrelevent parts. Thanks in advance!
function qaResults(){
document.body.style.cursor='wait';
***code here to find dbname and query1****
var d = new Date();
recReq = new ActiveXObject("Microsoft.XMLHTTP");
recReq.open("get", "ProduceTable.aspx?choice=queryResults&query=" +
query1 + "&dbname=" + dbname + "&timer=" + d.getTime(), false);
recReq.send();
if (recReq.readyState == 4)
{
if (recReq.status == 200)
{
document.getElementById('ResultsTable').innerHTML =
recReq.responseText;
document.getElementById('ResultsTable').style.height = "200px";
sortables_init();
}
else
alert("There was a problem retrieving HTML table:\n" +
recReq.statusText);
}
document.body.style.cursor = 'auto';
}