I'm confused about node.js and ajax. Can you guys give me the difference.
-
2You mean, other than one runs on a server, and the other on a browser?StuartLC– StuartLC2012-08-23 10:54:24 +00:00Commented Aug 23, 2012 at 10:54
-
3Please work on your accept ratio asap.Andrius Naruševičius– Andrius Naruševičius2012-08-23 10:55:46 +00:00Commented Aug 23, 2012 at 10:55
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
2 Comments
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
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.