The functions of JavaScript: 1. Embed dynamic text and HTML pages; 2. Respond to browser events; 3. Read and write HTML elements; 4. Verify data before the data is submitted to the server; 5. Detect visitors' browser information; 6. Control cookies, including creation and modification.
The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.
What role does javascript play?
JavaScript can realize page effect switching, animation effects, page games and other effects. JavaScript, however, takes on more responsibility. Especially with the rise of Ajax technology, the user experience of the website has been greatly improved. For example, when people enter a few words in Baidu's search box, the web page will intelligently sense what the user is going to search for next, and a drop-down menu will appear. The realization of this effect is inseparable from JavaScript. In addition, the use of JavaScript is not limited to browsers. The emergence of Node.js allows developers to write JavaScript code on the server side, making JavaScript more widely used.
To sum up, the daily uses of JavaScript can be summarized into the following main aspects:
1. Embed dynamic text in HTML pages.
2. Respond to browser events.
3. Read and write HTML elements.
4. Validate data before it is submitted to the server.
5. Detect the visitor’s browser information.
6. Control cookies, including creation and modification.
7. Server-side programming based on Node.js technology.
Introduction to JavaScript:
JavaScript ("JS" for short) is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is based on prototype programming, a multi-paradigm dynamic scripting language, and supports object-oriented, imperative, declarative, and functional programming paradigm.
JavaScript was first designed and implemented in 1995 by Brendan Eich of Netscape Company on the Netscape Navigator browser. Because Netscape was working with Sun, Netscape management wanted it to look like Java, hence the name JavaScript. But in fact its grammatical style is closer to Self and Scheme. [2]
The standard of JavaScript is ECMAScript. As of 2012, all browsers fully support ECMAScript 5.1, and older browsers support at least the ECMAScript 3 standard. On June 17, 2015, ECMA International released the sixth edition of ECMAScript, which is officially called ECMAScript 2015, but is usually called ECMAScript 6 or ES2015.
Recommended study: "javascript basic tutorial"
The above is the detailed content of What role does javascript play?. For more information, please follow other related articles on the PHP Chinese website!