XmlHttpRequest vs jQuery

I am new to javascript and jQuery. I am developing a page in which I created an entire HTML page from code. The page has a text box for sending messages, and comments can be published for each message. Now when I post a new comment or delete a comment, I need to make a database call. I know 2 methods for this from js

  • do xmlhttprequest
  • make an ajax call from jQuery.

Can someone suggest me which method will fit my requirements?

+6
source share
5 answers

Each browser has its own implementation of XmlHttpRequest. Using a structure minimizes the headache of cross-browser differences and quirks, especially if you are very new.

+11
source

xmlhttprequest does not work through a cross browser, for example, some versions of IE , so jQuery ajax call is the best option.

+3
source

read this . it will help you.

+2
source

jQuery will use the XMLHTTPRequest object itself. What it provides will be a wrapper for functions. Therefore, if you want to avoid the burden of writing javascript, which is designed for different browsers, then you can choose jQuery.

+2
source

At least today jQuery is not a clean or even quick solution, from this test the results for me on my mobile or desktop show that jQuery is at least 80% slower than XHR2: https://jsperf.com/ xhr-vs-jquery-ajax-vs-get-vs-fetch

0
source

All Articles