JavaScript The Definitive Guide, 5th Edition, Chapter 1, Section 1.1- 1.1.1. JavaScript Is Not Java
- One of the most common misconceptions about JavaScript is that it is a simplified version of Java, the programming language from Sun Microsystems. Other than an incomplete syntactic resemblance and the fact that both Java and JavaScript can provide executable content in web browsers, the two languages are entirely unrelated. The similarity of names is purely a marketing ploy by Netscape and Sun (the language was originally called LiveScript; its name was changed to JavaScript at the last minute). However, JavaScript can, in fact, script Java (see Chapters 12 and 23).
复制代码 1.1.1 JavaScript 并非 Java
对 JavaScript 最常见的误解是认为它是 Sun Microsystems 公司的程序设计语言 Java 的简化版本。但是除了语法上有一些相似之处以及都能够提供 Web 浏览器中的可执行内容之外,JavaScript 和 Java 是完全不相关的。名称上的相似纯粹是 Netscape 和 Sun 的一种营销策略罢了(该语言最初叫做 LiveScript,只是后来才改为 JavaScript)。然而,实际上 JavaScript 可以脚本化 Java(详见第12章和第23章)。 |