search
HomeWeb Front-endFront-end Q&AWhat language is JavaScript?

What language is JavaScript?

Oct 19, 2021 pm 02:36 PM
javascript

Javascript is a scripting language that is object- and event-driven, relatively safe, and widely used in client-side web development. It is also a scripting language that is widely used in client-side web development. It is often used for web pages. Add a variety of dynamic functions to provide users with a smoother and more beautiful browsing effect.

What language is JavaScript?

The operating environment of this tutorial: Windows 7 system, JavaScript version 1.8.5, Dell G3 computer.

JavaScript is a scripting language that is object- and event-driven, relatively safe, and widely used in client-side web development. It is also a scripting language that is widely used in client-side web development.

It has been widely used in web application development and is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects.

was first used in HTML to add dynamic functions to HTML web pages. It is a prototype-inherited object-oriented dynamic type case-sensitive client script language developed from Netscape's LiveScript. The main purpose is to solve the speed problems left by server-side languages, such as Perl, and respond to various user operations, providing customers with a smoother browsing effect. Because the server needed to verify the data at that time, because the network speed was quite 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. However, JavaScript can now also be used in web servers such as Node.js.

1. Composition of javascript

A complete JavaScript implementation is composed of the following 3 different parts:

  • ECMAScript: describes the language The syntax and basic objects of Model (BOM for short)): describes the methods and interfaces for interacting with the browser.

  • 2. The basic characteristics of javascript

is an interpreted scripting language (the code is not pre-compiled).

  • Mainly used to add interactive behaviors to HTML pages.

  • Can be directly embedded in HTML pages, but writing it as a separate js file is beneficial to the separation of structure and behavior.

  • 3. Characteristics of JavaScript

    Different from 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 , 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 today's 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. With the development of engines such as V8 and frameworks such as Node.js, and their features such as event-driven and asynchronous IO, JavaScript is gradually used to write server-side programs.

4. JavaScript is commonly used to complete the following tasks

1. Embed dynamic text in 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 visitor’s browser information

6. Control cookies, including creation and modification Wait

5. How to use Javascript

There are two ways to add Javascript to a web page: direct method and reference method.

1. Direct method

This is the most commonly used method. Most web pages containing Javascript use this method, for example:

<html>
      <head>
      <title>简单的JavaScript Hello World</title>
         <script type="text/javascript">
             document.write("Hello, PHP中文网!");   // 在浏览器视窗内直接显示
             alert("Hello,  PHP中文网!");            //  弹窗显示
             console.log("Hello,  PHP中文网!");      // 在控制台(console)里显示,需要先开启开发工具控制台
         </script>
      </head>
      <body>
   HTML页面内容……
      </body>
   </html>

In this example, we You can see a new tag:

<script>...</script>

, and

is used to tell the browser that this is Programs written in Javascript need to mobilize the corresponding interpreter for interpretation. (w3c has recommended the use of new standards:

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.