0

I am learning to implement Ajax using Jquery in ASP.NET MVC5 and have found following important functions:-

a. $.get

b. $.post

c. $(selector).load

d. $.ajax

As per my learning so far I am able to understand the scenarios where we should be using $.get, $.post and $(selector).load, but I am not able to understand where i should use $.ajax

Can any one please explain where I should use $.ajax? As I am not able understand the scenario where I should use $.ajax?

Regards

Mandeep

Mi-Creativity
  • 9,554
  • 10
  • 38
  • 47
  • Pretty sure $.ajax is just the generic ajax function for jquery, whereas $.post and $.get imply their respective ajax types – Nick Zuber Feb 14 '16 at 04:55
  • 1
    `$.get()` is just a shorthand method ([refer documentation](https://api.jquery.com/jquery.get/)) - ditto for `$.post()` and `.load()` (and there are more such as `$.getJSON()`) –  Feb 14 '16 at 04:58

2 Answers2

2
$.get(...) = $.ajax({method: "GET",...});
$.post(...) = $.ajax({method: "POST",...});
Royal Pinto
  • 2,869
  • 8
  • 27
  • 39
0

$.ajax() Performs an async AJAX request is the most configurable one, where you get fine grained control over HTTP headers and such.

More you see the @Alexander Sagen answer https://stackoverflow.com/a/3870130/5566169

Community
  • 1
  • 1
Nadimul De Cj
  • 484
  • 4
  • 16