且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是“Javascript"吗?也是服务器端语言?

更新时间:2023-11-27 22:04:28

尽管 JavaScript 最初是为了在浏览器中使用而开发的,但该语言本身从未成为严格的客户端语言.

Eventhough JavaScript was first developed to be used in a browser, the language itself has never been a strict client side language.

除了一些创建 HTML 标签的字符串方法之外,语言本身没有任何特定于客户端编程的内容.与浏览器相关的一切都在 DOM 中,而不是在 JavaScript 语言中.

Aside from a few string methods that create HTML tags, there is nothing in the language itself that is specific to client side programming. Everything related to the browser is in the DOM, not in the JavaScript language.

JavaScript 用于客户端脚本(这种用法几乎类似于客户端脚本),但将其标记为客户端语言会产生误导.该语言本身不包含浏览器集成这一事实使其很容易适应其他环境,包括服务器端脚本.

JavaScript is used in client side scripting (and that use is almost analogous to client side scripting), but branding it a client side language would be misleading. The fact that the language itself doesn't contain the browser integration has made it easy to adapt it to other environments, including server side scripting.

Node.js 远非唯一使用 JavaScript 的服务器端脚本.例如,ASP 提供 VBScript 和 JScript(Microsoft 的 JavaScript 实现)作为服务器端语言.此列表比较了 28 种不同的服务器端用途,而且还不止这些.

Node.js is far from the only server side scripting using JavaScript. ASP for example offered VBScript and JScript (Microsofts implementation of JavaScript) as server side languages. This list compares 28 different server side uses, and it's not all there is.