[From] http://developer.51cto.com/art/200907/140294.htm
==> Connection and difference between JavaScript and Java
JavaScript is similar to Java syntax, but similar to C and Java syntax. But it is not the Java prefix of JavaScript that expresses some contained or contained relationship between JavaScript and Java. JavaScript is not a subset of Java. In fact, it can be said that these two languages are completely irrelevant, just as C and Java can also be considered irrelevant.
Java's historical evolution and syntax features are well known. Many teaching materials and technical reference books have detailed descriptions. The history of JavaScript is traced back to a language named Cmm. Its standard features come from Cmm rather than Java or standard C. The creator of JavaScript is Brendan Eich. The earliest version is implemented in NetScapt2. Its initial name is Mocha. The Java language is Sun's masterpiece.
Although JavaScript and Java are completely irrelevant, JavaScript is a good partner to some extent. JavaScript can control browser behaviors and content, but cannot draw and execute connections. Although Java cannot control the browser in general, it can draw, execute connections and multithreading. The client's JavaScript can interact with the Java Applet embedded in the web page and control it. In this sense, JavaScript scripts are made of Java. It is very bad to use javascript on a webpage. It is best not to use javascript, especially for the mainstream SSH lightweight frameworks and architectures. scripting java in jsp files, that is, using JavaScript, as I described in the previous blog post, unless it is a master, and reading your article is also a master. I was not a master, so I was dizzy.
==> Differences and connections between JavaScript and JSP
JSP (Java Server Pages) is a dynamic web page technical standard proposed by Sun Microsystems and jointly established by many companies. JSP technology is a bit similar to ASP technology, it is in the traditional web page HTML file (*. htm ,*. insert the Java program segment (Scriptlet) and JSP tag in html to form a JSP file (*. jsp ). A JSP page consists of HTML code and Java code embedded in it. The server processes the Java code after the page is requested by the client, and then returns the generated HTML page to the browser of the client. Java
Servlet is the technical basis of JSP, and the development of large-scale Web applications requires the cooperation of Java Servlet and JSP. JSP is easy-to-use and fully object-oriented with Java technology. It is platform-independent, secure, and reliable. It mainly targets all features of the Internet.
JavaScript is a program code interpreted and executed by a browser. It is part of the content of a webpage and is mainly used to generate dynamic display effects on the webpage and implement interaction with users. A JSP program is the code interpreted and executed by the WEB server. It is used to generate webpage content displayed by the browser. Because JavaScript code is part of the content of a webpage, JavaScript code can also be output through a JSP page. The relationship between JavaScript and JSP is like the relationship between HTML code and JSP, that is, JavaScript code is a piece of special text that can be interpreted and executed by the browser by the JSP program. You only need to write a webpage document containing JavaScript code first, and then change the content of this webpage document to JSP program output.
==> JScript
Take a look at the definition of Baidu Encyclopedia:
JScript is an implementation of Microsoft's ECMA 262 language specification (ECMAScript Editor 3. Except a few exceptions (to maintain backward compatibility), JScript fully implements the ECMA standard. JScript is an interpreted and Object-based scripting language. Although JScript features are weaker than the mature object-oriented language such as C ++, JScript functions are large enough for its intended use.
JScript is not a lite version of other languages (for example, it only has a vague and indirect relationship with Java), nor is it a simplification of anything. However, it has its own limitations. For example, you cannot use this language to write applications that run independently without built-in support for reading and writing files. In addition, JScript can only run on an interpreter or host, such as Active Server Pages (ASP), Internet browser, or Windows Script Host.
JScript is a loose type language. Loose type means that you do not need to explicitly define the data type of the variable. In fact, JScript goes further. You cannot clearly define the data type on JScript. In addition, in most cases, JScript is automatically converted as needed. For example, if you add a value to an item (a string) composed of text, the value is converted to text.
JScript 8.0 is a new version of Microsoft's ECMA 262 language. By combining the JScript feature set of previous versions with the best features of class-based languages, JScript 8.0 contains the essence of these two fields.
Improvements to JScript 8.0 (being developed in conjunction with ECMAScript 4th) include: real compilation code, typed and non-typed variables, late and early binding, classes (with inheritance, function overloading, attribute accessors, etc.), packages, cross-language support, and.. NET Framework.
==> Conclusion
As a result, JScript is a product of Microsoft, while JavaScript is a product of Netscape. JScript was not available when JavaScript was just launched. At that time, JavaScript was very popular. microsoft is not very eye-catching. therefore, a script language is named JScript. at that time, the syntax in these two scripting languages was quite different, causing a lot of trouble for programmers at that time .. later, W3C came forward, and W3C unified standards. Therefore, the syntax of these two scripting languages can be said to be the same in more than 90%. The above section summarizes JScript, Java, JavaScript, and JSP.