Is there any advantage of using $.ajax() for ajax call against $.get() or $.post()?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What to do to select element having a particular class (".selected")? : jquery mobile

564


Explain .empty() vs .remove() vs .detach() in jquery

491


Is jquery is json library file or a javascript?

518


Explain the difference between find and children methods in jquery?

540


How to select class in jquery?

535






Tell me what are the slow selectors in jquery? : jquery mobile

507


How to write cookies in jquery?

3742


Is jquery a library for client scripting or server scripting? : jquery mobile

491


What is jquery.size()? : jquery mobile

549


What is jquery connect and how to use it?

618


What are the advantage of using minimized version of jquery?

501


What is the difference between prop and attr?

508


How can you use array with jquery?

532


How can jquery library be added to pages? Write a basic jquery code?

542


What does jQuery data() function do?

607