Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ajax and node.js

Tags:

ajax

node.js

I'm confused about node.js and ajax. Can you guys give me the difference.

like image 432
PCA Avatar asked Aug 23 '12 10:08

PCA


People also ask

Is AJAX used in Node JS?

This can be done by Ajax request, we are sending data to our node server, and it also gives back data in response to our Ajax request. Step 1: Initialize the node modules and create the package. json file using the following command.

Is JS and AJAX same?

Javascript provides client-side support whereas AJAX provides server-side support by exchanging data with the server. Javascript is applicable when there is an HTML and AJAX functionality that takes data using XMLHttpRequest. Javascript is a well-known programming language whereas AJAX is not a programming language.

What is the difference between jQuery and node JS?

jQuery is just a javascript library. NodeJS is a server side development platform, so that you can run javascript on a server. jQuery runs in NodeJS, but there would never be a need to "run" NodeJS on the clientside, because NodeJS just allows javascript to run on a server.

What is AJAX is used for?

AJAX stands for Asynchronous JavaScript And XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with servers. It can send and receive information in various formats, including JSON, XML, HTML, and text files.


3 Answers

The only similarity between AJAX and Node.js is that they are both JavaScript; yet they both serve completely different purposes.

AJAX (short for Asynchronous Javascript and XML) is a client-side technology, often used for updating the contents of a page without refreshing it. Such use can be seen just about everywhere; from Facebook, even to Stack Overflow.

Node.js is server-side JavaScript, used for developing server software. For example, you wouldn't want to develop a database system in client-side JS (since, well, anyone could access the database's credentials obviously), but such a task is possible with Node.js. Node.js doesn't get executed in a browser, but by a server - it's uses are very comparable to Apache/PHP, Ruby on Rails, Django, and the like.

TL;DR: AJAX is for client-side stuff, Node.js for server-side stuff

like image 129
Kyle Lacy Avatar answered Oct 09 '22 15:10

Kyle Lacy


In easy term, The difference between Node.js and Ajax is that, Ajax (short for Asynchronous JavaScript and XML) is a client side technology, often used for updating the contents of the page without refreshing it. While,Node.js is Server Side JavaScript, used for developing server software. Node.js does not execute in the browser but by the server.

like image 43
Pankaj Chauhan Avatar answered Oct 09 '22 15:10

Pankaj Chauhan


Node is full development environment allowing you to thing normal js cannot not like communicate with databases. Ajax is just a technique to get data or scripts from an external file.

like image 22
user6016061 Avatar answered Oct 09 '22 16:10

user6016061