Is there any advantage of using $.ajax() for ajax call against $.get() or $.post()?
Answer / chaitanya
By using jQuery post()/ jQuery get(), you always trust the response from the server and you believe it is going to be successful all the time. Well, it is certainly not a good idea to trust the response. As there can be n number of reason which may lead to failure of response.
Where jQuery.ajax() is jQuery's low-level AJAX implementation. $.get and $.post are higher-level abstractions that are often easier to understand and use, but don't offer as much functionality (such as error callbacks). Find out more here.
| Is This Answer Correct ? | 2 Yes | 0 No |
Define width() vs css('width')?
How to check/uncheck an input in jquery?
What are the guidelines for an application to follow the principles of progressive enhancement.
How method can be called inside code behind using jQuery?
Why there are two different version of jQuery library?
How to multiple AJAX requests be run simultaneously in jQuery?
Difference between javascript and jquery? : jQuery Mobile
Why we use jquery .each() function?
Why should I use jquery?
How to find all sibling elements after the current element using ?
How to add a class to html element?
What is the use of jquery.data()?