15

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

2
  • 2
    You mean, other than one runs on a server, and the other on a browser? Commented Aug 23, 2012 at 10:54
  • 3
    Please work on your accept ratio asap. Commented Aug 23, 2012 at 10:55

3 Answers 3

40

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

Sign up to request clarification or add additional context in comments.

2 Comments

So, what is so great about node.js then?
@GamesBrainiac I think many people prefer it over other server-side languages because it provides a unified language; anything pertaining to web development could be done with JavaScript coupled with Node.js. Personally, I don't much care for JavaScript, and don't really understand the appeal. Node.js can't do anything that you can't do with other dynamic web technologies (like Rails, Django, PHP, etc).
4

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.

Comments

2

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.

1 Comment

Ajax stands for asynchronous javascript it is a technique used to either run external scripts, obtain data such as json, obtain external json and rub php scripts. Whereas node js is almost a while development environment with a file system and many features js would not usually be able to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.