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.
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 id="PHP中文网-https-www-php-cn">PHP中文网:https://www.php.cn/</h1>"); </script> </head> <body></body> </html>
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>
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.
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.
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.
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
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.
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
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.
(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!

去掉重复并排序的方法:1、使用“Array.from(new Set(arr))”或者“[…new Set(arr)]”语句,去掉数组中的重复元素,返回去重后的新数组;2、利用sort()对去重数组进行排序,语法“去重数组.sort()”。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于Symbol类型、隐藏属性及全局注册表的相关问题,包括了Symbol类型的描述、Symbol不会隐式转字符串等问题,下面一起来看一下,希望对大家有帮助。

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于对象的构造函数和new操作符,构造函数是所有对象的成员方法中,最早被调用的那个,下面一起来看一下吧,希望对大家有帮助。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于面向对象的相关问题,包括了属性描述符、数据描述符、存取描述符等等内容,下面一起来看一下,希望对大家有帮助。

方法:1、利用“点击元素对象.unbind("click");”方法,该方法可以移除被选元素的事件处理程序;2、利用“点击元素对象.off("click");”方法,该方法可以移除通过on()方法添加的事件处理程序。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于BOM操作的相关问题,包括了window对象的常见事件、JavaScript执行机制等等相关内容,下面一起来看一下,希望对大家有帮助。

foreach不是es6的方法。foreach是es3中一个遍历数组的方法,可以调用数组的每个元素,并将元素传给回调函数进行处理,语法“array.forEach(function(当前元素,索引,数组){...})”;该方法不处理空数组。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
