How can I find out which method is best for a situation? Can anybody provide some examples to know the difference in terms of functionality and performance?
As far as the jQuery methods go, .post
and .get
simply do .ajax
internally, their purpose is to abstract away some of the unnecessary options of .ajax
and provide some defaults appropriate to that type of request respectively.
I doubt there's much difference in performance between any of the 3.
The .ajax
method in itself does an XMLHttpRequest, it'll be heavily optimised as per the rest of jQuery, but it probably won't be as efficient as if you tailored the whole interaction yourself.. but that's the difference between writing lots of code or writing jQuery.ajax
.