Home >Web Front-end >JS Tutorial >Is JavaScript a network protocol?
JavaScript is not a network protocol, but an interpreted scripting language. Javascript is a prototype-inherited object-oriented dynamic type case-sensitive client-side scripting language. Its main purpose is to solve the speed problem left by server-side languages and provide customers with a smoother browsing effect.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Javascript is a prototype-inherited, object-oriented, dynamically typed, case-sensitive client-side scripting language developed from Netscape's LiveScript. The main purpose is to solve the legacy problems of server-side languages, such as Perl. speed issues to provide customers with a smoother browsing effect. At that time, the server needed to verify the data. Since the network speed was very slow, only 28.8kbps, the verification step wasted too much time. So Netscape's browser Navigator added Javascript to provide basic functions of data verification.
The official name of JavaScript is "ECMAScript". This standard is developed and maintained by the ECMA organization. ECMA-262 is the official JavaScript standard. This standard is based on JavaScript (Netscape) and JScript (Microsoft). Brendan Eich of Netscape (Navigator 2.0) invented the language, which has appeared in all Netscape and Microsoft browsers since 1996. Development of ECMA-262 began in 1996, and in July 1997, the ECMA General Assembly adopted its first version.
JavaScript script language has the following characteristics:
(1) Script language. JavaScript is an interpreted scripting language. Languages such as C and C are compiled first and then executed, while JavaScript is interpreted line by line during the running of the program.
(2) Based on objects. JavaScript is an object-based scripting language that can not only create objects but also use existing objects.
(3)Simple. The JavaScript language uses weakly typed variable types and does not impose strict requirements on the data types used. It is a scripting language based on Java's basic statements and controls, and its design is simple and compact.
(4)Dynamic. JavaScript is an event-driven scripting language that can respond to user input without going through a Web server. When visiting a web page, JavaScript can directly respond to these events when the mouse is clicked, moved up or down, or moved in the window.
(5) Cross-platform. The JavaScript scripting language does not depend on the operating system and only requires browser support. Therefore, after writing a JavaScript script, it can be brought to any machine for use, provided that the browser on the machine supports the JavaScript scripting language. JavaScript has been supported by most browsers. Unlike server-side scripting languages, such as PHP and ASP, JavaScript is mainly used as a client-side scripting language to run on the user's browser and does not require server support. Therefore, in the early days, programmers preferred JavaScript to reduce the burden on the server, but at the same time it also brought about another problem, security.
As servers become more powerful, although programmers prefer scripts running on the server to ensure security, JavaScript is still popular for its cross-platform and easy-to-use advantages. At the same time, some special functions (such as AJAX) must rely on JavaScript to be supported on the client side.
Main functions
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. Control cookies, including creation and modification.
6. Server-side programming based on Node.js technology.
[Related recommendations: javascript learning tutorial]
The above is the detailed content of Is JavaScript a network protocol?. For more information, please follow other related articles on the PHP Chinese website!