Search This Blog

Wednesday, November 07, 2018

Difference between XMLHttpRequest, jQuery.ajax, jQuery.post and jQuery.get

XMLHttpRequest in the raw browser object that jQuery wraps into a more usable and simplified form and cross browser consistent functionality.

All jQuery functions use XMLHttpRequest object in the background, but provide additional functionality that you don't have to do yourself.

jQuery.ajax is a general Ajax request in jQuery that can do any type and content requests.

jQuery.get and jQuery.post can only issue GET and POST requests. Internally these two functions use jQuery.ajax but they use particular settings that you don't have to set yourself thus simplifying GET or POST request compared to using jQuery.ajax