28

I have tried a few examples with Node.js, but still I have a confusion between jQuery and Node.js.

All I know at this point in time is that Node.js and jQuery perform two different roles. One facilitates server-side JavaScript, and the other provides an abstraction library for client-side JavaScript.

I have seen some other links also on Stack Overflow related to Node.js and jQuery but I didn't get what I wanted.

What is the feature difference or what is it special that Node.js does which will make me think to go with it? What benefits will I get if I choose to go with Node.js? I know Node.js works on event-driven programming, not an object-oriented programming language, but what else are the other things I can do with Node.js which I can not do with jQuery or other frameworks?

I have a few question like:

  1. What can be done by Node.js which can not be done by jQuery?

  2. Is Node.js capable of consuming web services? If yes, then is it possible to do the same with jQuery? If not, then what is the reason for it?

  3. What are the features of Node.js? How it is different from jQuery?

  4. In which situation should I go with Node.js or jQuery?

  5. What are some special features of Node.js and jQuery? Benefits of using both?

Community
  • 1
  • 1
Sau
  • 2,109
  • 6
  • 21
  • 22

1 Answers1

64

The main difference is Node.js is server side and jQuery is client side.

  1. What can be done by Node.js which can not be done by jQuery?

Node.js enables server side code to be written in JavaScript capability which can not be achieved by jQuery.

  1. Is Node.js capable of consuming web services? If yes, then is it possible to do the same with jQuery? If not, then what is the reason for it?

Both are capable of consuming a web service. The difference is jQuery will be doing it in client side while Node.js will be doing it in server side.

  1. What are the features of Node.js? How it is different from jQuery?

The main difference is it enables server scripting in JavaScript.

  1. In which situation should I go with Node.js or jQuery?

Server side scripting, like replacement for PHP, ASP.NET

  1. Please also mention some special features of Node.js and jQuery?

Benefits of using both?

Node.js enables server-side scripting in JavaScript. jQuery simplify client-side scripting.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Emmanuel N
  • 7,350
  • 2
  • 26
  • 36
  • 6
    I think this answers all of the questions :) – Ram Mar 16 '13 at 08:12
  • 3
    jQuery can be used in NodeJS as well, if just for core. Theres Cheerio as well. – elclanrs Mar 16 '13 at 08:13
  • jQuery is JavaScript library! , it can be used in server side .. – rab Mar 16 '13 at 08:13
  • Emmanuel N thanks for the right answer .I think you are the only one who understand what i asked for because i already mention in my question that Node.js is for server-side JavaScript, & JQuery provides an abstraction library for client-side JavaScript. I accepted your answer Thanks a lot. – Sau Mar 16 '13 at 08:37
  • 3
    I feel like these answers are from people that have never learned javascript. 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. – dacopenhagen May 30 '13 at 16:49