新手:JavaScript VS Node JS [英] newbie: JavaScript VS Node JS

查看:32
本文介绍了新手:JavaScript VS Node JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在浏览器中加载并执行了JavaScript文件,服务器如何知道该文件何时是节点js文件,从而在服务器上执行?

If JavaScript files are loaded and executed in the browser how does the server know when the file is a node js file, therefore to execute on the server?

推荐答案

JavaScript是一种语言.node.js不是语言,而是环境/软件集".运行普通的JavaScript.

JavaScript is a language. node.js is not a language but an "environement/set of software" that runs normal JavaScript.

所有浏览器都具有运行网页JavaScript的JavaScript引擎(用于Firefox的Spidermonkey,用于Chrome的V8).

All browsers have JavaScript engines that run the JavaScript of web pages (Spidermonkey for Firefox, V8 for Chrome).

Node.js只是V8引擎,捆绑了一些库以进行I/O和联网,因此您可以在浏览器之外使用JavaScript(例如,创建后端服务).

Node.js is simply the V8 engine bundled with some libraries to do I/O and networking, so that you can use JavaScript outside of the browser (e.g, to create backend services).

这篇关于新手:JavaScript VS Node JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆