Home  >  Article  >  Web Front-end  >  Is JavaScript a language?

Is JavaScript a language?

青灯夜游
青灯夜游Original
2021-11-04 15:56:052595browse

JavaScript is a language. JavaScript is a lightweight, interpreted or just-in-time compiled programming language with function priority. It is a dynamic scripting language based on prototype programming and multi-paradigm. It is often used to add various dynamic functions to web pages and provide users with Provide a smoother and more beautiful browsing effect.

Is JavaScript a language?

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

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 is a high-level scripting language for the Internet. It has been widely used in Web application development. It is often used to add various dynamic functions to web pages and provide users with smoother and more beautiful browsing effects.

Complete JavaScript is composed of the following three parts:

  • Core (ECMAScript): Provides the syntax and basic objects of the language;

  • Document Object Model (DOM): Provides methods and interfaces for processing web content;

  • Browser Object Model (BOM): Provides and interfaces with browsers Methods and interfaces for interaction.

JavaScript is commonly used to complete the following tasks

1. Embed dynamic text in HTML pages

2. Respond to browser events Make a response

3. Read and write HTML elements

4. Verify the data before it is submitted to the server

5. Detect the visitor's browser information

6. Control cookies, including creation and modification.

The difference between JavaScript and Java

Many people see that both Java and JavaScript have the four words "Java". I thought they were the same thing, even myself at first. In fact, the JAVA language and the JavaScript language are related, but their connection is not as close as you think. First of all, the Java language is a product of SUN Microsystems, while JavaScript is a product of Netscape.

Secondly, there are some differences in their functions: the application that Java runs on the client is called Java Applet, which is a small program embedded in a web page and has its own independent running window. Java Applets are pre-compiled. If you open an Applet file (.class) with Notepad and read it, you cannot understand it at all. Java Applet is very powerful. It can access http, ftp and other protocols, and can even plant viruses on the computer (there is precedent).

In comparison, JavaScript’s capabilities are relatively small. JavaScript is a kind of "script" ("Script"). It writes codes directly into HTML documents, and compiles and executes them when the browser reads them. Therefore, if you can view the HTML source file, you can view the JavaScript source code. JavaScript does not have an independent running window. The current window of the browser is its running window. The only similarity between them, I think, is that they use Java as the programming language.

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of Is JavaScript a language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn