P
pbd22
Hi.
It seems my xmlhttp response is taking too long. I have something like
this:
try
{
if (a === "")
err += "some error";
if (b==="")
err += "some error";
if (c==="")
{
err += "some error";
}
else
{
// use an xmlhttp request to compare a condition
// that must be evaluated from the server. the response
// is true or false.
}
}
catch{}
finally{
if (err ==="")
//submit the form
else
//let the user know about the errors.
}
THE PROBLEM is that the logic does not publish the response of the
Ajax request
because the round-trip takes too long. I have tested this by adding an
alert. If the alert
fires and then I click off the alert dialog, the appropriate response
from the Ajax request
is in the error list. But, otherwise, it seems like the time it takes
to respond is omitting the
response in the error list.
Is there a way in JavaScript in an If/Else scenario to force getting
the appropriate response
from the Ajax request before the next code block is evaluated?
Thanks in advance.
It seems my xmlhttp response is taking too long. I have something like
this:
try
{
if (a === "")
err += "some error";
if (b==="")
err += "some error";
if (c==="")
{
err += "some error";
}
else
{
// use an xmlhttp request to compare a condition
// that must be evaluated from the server. the response
// is true or false.
}
}
catch{}
finally{
if (err ==="")
//submit the form
else
//let the user know about the errors.
}
THE PROBLEM is that the logic does not publish the response of the
Ajax request
because the round-trip takes too long. I have tested this by adding an
alert. If the alert
fires and then I click off the alert dialog, the appropriate response
from the Ajax request
is in the error list. But, otherwise, it seems like the time it takes
to respond is omitting the
response in the error list.
Is there a way in JavaScript in an If/Else scenario to force getting
the appropriate response
from the Ajax request before the next code block is evaluated?
Thanks in advance.