Reputation: 33
In jQuery
$.get
method and $.post
method?$.Ajax
is better than above things y we are using .get
and .post
method?Upvotes: -2
Views: 56
Reputation: 2967
$.get
and $.post
are subsets of the $.ajax
method.
They're already set up for GET
and POST
requests and make it easier and quicker to code, in addition to making your code more readable.
$.ajax
offers more control, but at the expense of readability, and speed (in terms of coding). It's more extensible, so is suited for functions where your standard $.get
or $.post
may not be sufficient.
Use whichever works for you. If all you're doing is trying to POST
data, then $.post
let's you do this simply. If you want more control, use $.ajax
.
Upvotes: 1