what is the difference between ajax and jquery and which one is better?

JqueryAjax

Jquery Problem Overview


I am confused about using ajax or jquery so I want to know what the differences are and which one is better such as performance and complexity .

Jquery Solutions


Solution 1 - Jquery

AJAX is a technique to do an XMLHttpRequest (out of band Http request) from a web page to the server and send/retrieve data to be used on the web page. AJAX stands for Asynchronous Javascript And XML. It uses javascript to construct an XMLHttpRequest, typically using different techniques on various browsers.

jQuery (website) is a javascript framework that makes working with the DOM easier by building lots of high level functionality that can be used to search and interact with the DOM. Part of the functionality of jQuery implements a high-level interface to do AJAX requests. jQuery implements this interface abstractly, shielding the developer from the complexity of multi-browser support in making the request.

Solution 2 - Jquery

On StackOverflow, pressing the up-vote button is AJAX whereas typing in your question or answer and seeing it appear in the real-time preview window below it is JavaScript (JQuery).

This means that the difference between AJAX and Javascript is that AJAX allows you to communicate with the server without doing a page refresh (i.e. going to a new page) whereas JavaScript (JQuery) allows you to embed logic and behaviour on your page. Of course, with this logic you create AJAX as well.

Solution 3 - Jquery

A more simple English explanation: jQuery is something that makes AJAX and other JavaScript tasks much easier.

Solution 4 - Jquery

Ajax is a technology / paradigm, whereas jquery is a library (which provides - besides other nice functionality - a convenient wrapper around ajax) - thus you can't compare them.

Solution 5 - Jquery

It's really not an 'either/or' situation. AJAX stands for Asynchronous JavaScript and XML, and JQuery is a JavaScript library that takes the pain out of writing common JavaScript routines.

It's the difference between a thing (jQuery) and a process (AJAX). To compare them would be to compare apples and oranges.

Solution 6 - Jquery

AJAX is a way of sending information between browser and server without refreshing page. It can be done with or without library like jQuery.

It is easier with the library.

Here is a list of JavaScript libraries/frameworks commonly used in AJAX development.

Solution 7 - Jquery

They aren't comparable.

Ajax (Asynchronous Javascript and XML) is a subset of javascript. Ajax is way for the client-side browser to communicate with the server (for example: retrieve data from a database) without having to perform a page refresh.

jQuery is a javascript library that standardizes the javascript differences cross-browser. jQuery includes some ajax functions.

Solution 8 - Jquery

Ajax is a way of using Javascript for communicating with serverside without loading the page over again. jQuery uses ajax for many of its functions, but it nothing else than a library that provides easier functionality.

With jQuery you dont have to think about creating xml objects ect ect, everything is done for you, but with straight up javascript ajax you need to program every single step of the ajax call.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSufian AlaliView Question on Stackoverflow
Solution 1 - JquerytvanfossonView Answer on Stackoverflow
Solution 2 - JqueryLukeView Answer on Stackoverflow
Solution 3 - JqueryceejayozView Answer on Stackoverflow
Solution 4 - JqueryPhilSView Answer on Stackoverflow
Solution 5 - JqueryGeorge StockerView Answer on Stackoverflow
Solution 6 - JqueryMahtarView Answer on Stackoverflow
Solution 7 - JqueryEmilyView Answer on Stackoverflow
Solution 8 - JqueryChris DaleView Answer on Stackoverflow