jQuery 和 Node.js 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15447041/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between jQuery and Node.js?
提问by Sau
I have tried a few examples with Node.js, but still I have a confusion between jQuery and Node.js.
我已经尝试了一些 Node.js 的例子,但我仍然对 jQuery 和 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.
目前我只知道 Node.js 和 jQuery 扮演着两个不同的角色。一个为服务器端 JavaScript 提供便利,另一个为客户端 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.
我在 Stack Overflow 上也看到了一些与 Node.js 和 jQuery 相关的其他链接,但我没有得到我想要的。
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?
Node.js 有什么特性差异或者它有什么特别之处,这会让我想到去使用它?如果我选择使用 Node.js,我会得到什么好处?我知道 Node.js 适用于事件驱动编程,而不是面向对象的编程语言,但是我可以用 Node.js 做的其他事情是我不能用 jQuery 或其他框架做的吗?
I have a few question like:
我有几个问题,例如:
What can be done by Node.js which can not be done by jQuery?
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?
What are the features of Node.js? How it is different from jQuery?
In which situation should I go with Node.js or jQuery?
What are some special features of Node.js and jQuery? Benefits of using both?
Node.js 可以做哪些 jQuery 做不到的事情?
Node.js 是否能够使用 Web 服务?如果是,那么是否可以用 jQuery 做同样的事情?如果不是,那是什么原因呢?
Node.js 有哪些特点?它与 jQuery 有何不同?
在哪种情况下我应该使用 Node.js 或 jQuery?
Node.js 和 jQuery 有哪些特殊功能?两者同时使用的好处?
回答by Emmanuel N
The main difference is Node.jsis server side and jQueryis client side.
- What can be done by Node.js which can not be done by jQuery?
- Node.js 可以做哪些 jQuery 做不到的事情?
Node.js enables server side code to be written in JavaScript capability which can not be achieved by jQuery.
Node.js 使服务器端代码能够用 jQuery 无法实现的 JavaScript 功能编写。
- 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?
- Node.js 是否能够使用 Web 服务?如果是,那么是否可以用 jQuery 做同样的事情?如果不是,那是什么原因呢?
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.
两者都能够使用 Web 服务。不同之处在于 jQuery 将在客户端执行,而 Node.js 将在服务器端执行。
- What are the features of Node.js? How it is different from jQuery?
- Node.js 有哪些特点?它与 jQuery 有何不同?
The main difference is it enables server scripting in JavaScript.
主要区别在于它启用 JavaScript 中的服务器脚本。
- In which situation should I go with Node.js or jQuery?
- 在哪种情况下我应该使用 Node.js 或 jQuery?
Server side scripting, like replacement for PHP, ASP.NET
服务器端脚本,例如替代 PHP、ASP.NET
- Please also mention some special features of Node.js and jQuery?
- 还请提及 Node.js 和 jQuery 的一些特殊功能?
Benefits of using both?
两者同时使用的好处?
Node.js enables server-side scripting in JavaScript. jQuery simplify client-side scripting.
Node.js 在 JavaScript 中启用服务器端脚本。jQuery 简化了客户端脚本。