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



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

Post New Answer

More jQuery Interview Questions

What is the use of delay() method in JQuery?

1 Answers  


What does jQuery data() function do?

1 Answers  


Explain .live()? : jquery mobile

1 Answers  


Whether jQuery HTML work for both HTML and XML documents?

1 Answers  


How to check data type of any variable in jquery? : jquery mobile

1 Answers  


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

1 Answers  


Define url paremeter of jquery ajax method?

1 Answers  


What are the various ajax functions?

1 Answers  


How to select class in jquery?

1 Answers  


Does jQuery 2.0 supports IE?

3 Answers  


Explain .bind() vs .live() vs .delegate() vs .on()

2 Answers  


What is the difference between event.PreventDefault and event.stopPropagation?

1 Answers  


Categories