Loading
AJax call is Success or failed

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How you come to know if an AJax call is Success or failed ?


Ans)

onreadystatechange is a event listener in AJAX,  this will be automatically invoked
for all the actions such as submiting data, finishing call etc., of any Ajax call,
and these would change the readyState property of the XMLHttpRequest object,
that will inform you if the given Ajax request is successed or failed.

So by using readyState value we can see check if a given Ajax call is successful or not,
if readyState Value is 4, we could consider that is successful. You could also check
"xmlhttp.status==200"

xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState == 4 && xmlhttp.status==200){
            alert(xmlhttp.readyState);
        }

};
xmlhttp.open("GET","somepage.xml",true);
xmlhttp.send(null);



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

AJax call is Success or failed


AJax call is Success or failed

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free