Home  >  Article  >  Web Front-end  >  What language is JavaScript?

What language is JavaScript?

青灯夜游
青灯夜游Original
2022-08-25 17:24:059959browse

Javascript is a cross-platform interpreted, dynamically typed, weakly typed, prototype-based scripting language. JavaScript is a network scripting language that has been widely used in web application development. It is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects. JavaScript code cannot run independently. Generally, you need to use script tags to place it in HTML and run it with the help of the browser environment.

What language is JavaScript?

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

What language is javascript

JavaScript is a dynamically typed, weakly typed, prototype-based scripting language. Its interpreter is called the JavaScript engine, which is part of the browser and is widely used in client-side scripting languages. It was first used on HTML web pages to add dynamic functions to HTML web pages.

JavaScript is a network scripting language that has been widely used in Web application development. It is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects. Usually JavaScript scripts realize their functions by embedding them in HTML.

JavaScript is a cross-platform interpreted language that does not require pre-compilation and can run under various operating systems.

JavaScript has the following characteristics:

1) Interpreted scripting language

JavaScript is an interpreted scripting language, similar to C, C and other languages Different from needing to compile before running, code written in JavaScript does not need to be compiled and can be run directly.

2) Object-oriented

JavaScript is an object-oriented language. Using JavaScript, you can not only create objects, but also operate and use existing objects.

3) Weak type

JavaScript is a weakly typed programming language that does not have strict requirements on the data type used. For example, you can initialize a variable to any type, or you can initialize it at any time. Change the type of this variable.

4) Dynamic

JavaScript is an event-driven scripting language that can respond to user input without the help of a Web server. For example, when we visit a web page , when you click on a web page with the mouse or scroll the window, you can directly respond to these events through JavaScript.

5) Cross-platform

JavaScript does not depend on the operating system and can run in the browser. Therefore, after a JavaScript script is written, it can be run on any system, as long as the browser on the system supports JavaScript.

Run JavaScript code

JavaScript programs cannot run independently and can only be executed in the host environment. Under normal circumstances, JavaScript code can be placed in the web page and run with the help of the browser environment.

Embedding JavaScript scripts in HTML pages requires the use of the <script> tag. Users can directly write JavaScript code in the <script> tag</script>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>JavaScript程序</title>
    <script type="text/javascript">
        document.write("<h1>PHP中文网:https://www.php.cn/</h1>");
    </script>
</head>
<body></body>
</html>

What language is JavaScript?

You can also place JavaScript code in a JavaScript script file. JavaScript script files are text files with the extension .js and can be edited using any text editor. JavaScript files can then be imported into HTML pages using the <script> tag. </script>

Example:

Write the following JavaScript code in the test.js file.

alert("PHP中文网:https://www.php.cn/");

Insert a <script> tag within the <head> tag of the HTML document. Define the src attribute and set the attribute value to a URL string pointing to an external JavaScript file. The code is as follows: <br/></script>

<script type="text/javascript" src="test.js"></script>

What language is JavaScript?

Note: When using the <script> tag to include external JavaScript files, the default file type is Javascript. Therefore, regardless of whether the loaded file has a .js extension or not, the browser will parse it as a JavaScript script. </script>

What JS can do

JavaScript can be used in various areas of web development, such as:

  • Web application development: The web pages we browse in daily life are composed of HTML, CSS, and JavaScript. Through JavaScript, the styles of elements in the web page can be updated in real time, and the interaction between people and web pages can be realized ( For example, monitor whether the user clicks the mouse or presses a key, etc.), and you can also add some cool animations to the web page;

  • Mobile application development: In addition to web applications In addition to development, JavaScript can also be used to develop applications on mobile phones or tablets, and we can also use some excellent frameworks (such as React Native) to make development easier;

  • Web games: The small games we have played on the web can all be implemented using JavaScript;

  • Back-end Web application development: In the past, we used JavaScript to develop the front-end part of Web applications, but with the emergence of Node.JS (a JavaScript runtime environment), JavaScript can also be used Used to develop the backend part of web applications.

JavaScript Game Engine

Using HTML5, CSS3 and Javascript can help object-oriented developers develop games with various features, such as: 3D Animation effects, Canvas, math, colors, sounds, WebGL and more. The most obvious advantage is that games developed using HTML5 can run on any modern and popular device.

1. Crafty

craftyJS is a lightweight, modular JavaScript game engine that includes many components: animation, event management, re-zoning, collision detection, sprites, etc. It supports all types of browsers, such as IE9. No dom manipulation and custom drawing programs required.

What language is JavaScript?

2. Quintus

Quintus engine is an HTML5 game engine, modular, lightweight, and with concise Javascript-friendly syntax. Quintus is an easy-to-learn, fun-to-use JavaScript HTML5 game engine that supports mobile and desktop development. Contains a modular engine to easily develop games and run multiple instances on the same page.

What language is JavaScript?

3. Gamequery

gameQuery is an easy-to-use jQuery plug-in that can help develop Javascript games by adding game-related classes. Since it uses DOM operations Instead of Canvas gameQuery, it is now compatible with a large number of browsers, even older versions: Firefox, Chrome, Internet Explorer, Safari, Safari for iOS, mobile versions of Webkit and Opera.

What language is JavaScript?

4. GMP

GMP is an outstanding engine for making sprite-based, 2D games. It can easily design the most retro-style arcade games, and is also a good tool for making games (such as sudoku and gogopop). Online demonstration

What language is JavaScript?

5. lycheeJS

lycheeJS is a JavaScript game library that provides complete prototype solutions and HTML5 Canvas deployment in a web browser or native environment WebGL or native OpenGL (ES) based games. The development process of this project optimizes Google Chrome and its own development tools.

What language is JavaScript?

6. Enchant.js

Enchant.js is a simple JavaScript framework that can use HTML5 and JavaScript to develop simple games and applications. It is still developed and maintained by UEI's Akihabara Research Center. Online Demo

What language is JavaScript?

7. Starlingjs

Starling Starling is an ActionScript 3 2D framework developed based on Stage3D APIs (available for Flash Player 11 and Adobe AIR 3 desktop). Starling is designed for game development, but you can use it for many other applications. Starling makes it possible to write applications with fast GPU acceleration without having to involve low-level Stage3D APIs.

What language is JavaScript?

(Learning video sharing: Getting started with web front-end)

The above is the detailed content of What language is JavaScript?. 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