I understand that $.ajax is utilizing XMLHttpRequest to accomplish the same task and that there is a slight difference in terms of speed,I also realize that XHR can be tailor-made to meet my requirements but my doubt is with respect to functionality.
Basically I would like to know if $.ajax can accomplish everything that XHR can or is XHR superrior somehow.
If there isn’t any advantage of XHR over $.ajax, should I try and understand all the Http header requests or just be satisfied with $.ajax?
Thanks
There are a couple of things
$.ajaxdoesn’t have built-in functionality for (like aborting a request) but$.ajaxactually returns the XMLHttpRequest object, which allows you to tap into and manipulate that directly.Since jQuery just extends XMLHttpRequest there’s nothing that I can think of that XMLHttpRequest can do that you can’t accomplish with the jQuery extension as well.