Just wondering, in my opinion the code below is able to run a second ajaxfunction when the first one completes.
if(xmlHttp) // xmlHttp is an XMLHttpRequest开发者_JAVA百科 object
{
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
// second call can be made here because a first one is ready?
}
}
Am I correct on this? Or do I misunderstand the thing I want to achieve?
yes you can do that, but it might be better to call a function that does your second request flow.
精彩评论