Tutor Hunt Questions
“How to get ajax success and failure call backs ?
7 years ago
AJAX Question asked by Fakhir

Know the Answer?
Please enter your response to the question below. The student will get a notification as soon your response has been approved by our moderation team.
1 Answer
This can be achieved by using Javascri pt Promise object. A Javascri pt Promise is an object that represents a result of an Ajax request (in fact any asynchronous request). The $.ajax() method returns jqXHR object and jqXHR implements the Promise interface. Hence, upon calling $.ajax() you can use done(), fail() and always() methods of the Promise interface to wire the respective callback functions