XMLHttpRequest is a raw ajax request object. Working directly with this would be the “easiest”, but you lose all the cross-browser compatibility provided by the $ .ajax () method in jQuery. If you want your code to work in all browsers, you should use $ .ajax ().
source
share