search
HomeWeb Front-endJS TutorialFrom basics to proficiency-javascript language

From basics to proficiency-javascript language

Jun 26, 2017 am 11:50 AM
javascriptjsprincipleBase

Javascript is an interpreted programming language with object-oriented capabilities. It is a client-side scripting language that is object- and time-driven and relatively secure. Because it does not need to run in a language environment, it only needs a browser that supports it. Its main purpose is to verify the data sent to the server, increase web interaction, and enhance user experience.

The difference between interpreted language and compiled language

Interpreted language: This is the program that is compiled during operation Compiled into machine language.

        Compiled language : This type of language has a compilation process when running the program, but the program is not compiled into machine language, but into bytecode. For example, when the Java language is running, the JVM translates the bytecode into machine language. JVM is a java virtual machine, which is a fictitious computer.

But the efficiency of compilation of interpreted languages ​​is slower than that of compiled languages. JavaScript is an interpreted language. When it parses the program on the browser, js uses its own interpretation engine on the browser. javascript v8 engine. When the browser core compiles js into a view, it needs to go through three stages: "lexical analysis", "grammatical analysis" and "code generation". This is an obvious characteristic of compiled languages. For details, see Chapter 2 of "Rhinoceros Book" and "JavaScript You Don't Know" Chapter 1.

java code is executed by JVM

javascript is executed by javascript interpreter

Each Browsers are different and are generally included in the kernel of each browser.

The browser kernel generally contains two engines: Page layout engine and JS engine

IE uses its own Trident kernel

FireFox is the Gecko kernel

Opera is the Presto kernel

Safari uses the Webkit kernel

Chrome is Google’s own javascript V8 engine and its page layout uses the Webkit kernel

JavaScript is a scripting language, and scripting language is also an interpreted language. Scripting language does not need to be compiled, it is directly interpreted Just use the tool to explain. Judging from the argument that JavaScript is a compiled language just now, JavaScript is also a compiled language. It cannot be generalized as a scripting language. The way to understand scripting languages ​​is simple.

Write a program called xxx.exe. Click .exe to open a file with the extension .aa. Then you have specified rules for writing .aa files. This is what the script does and its relationship. Use instructions to let the program execute in order.

Understanding the relationship and principles of javascript in the browser kernel

Principles of browser parsing and rendering pages:

Talking about this I must mention the familiar webkit, the rendering engine of Google Chrome. The rendering engines in other browsers are not the same, and the core engines of each browser are inconsistent, so now we have to deal with a lot of compatibility issues with major browsers in the process of writing HTML code to layout the page structure. .

The most important and core part of the browser is the interpretation engine, which is the browser kernel. A web page needs to use two engines to work properly: a rendering engine and an interpretation engine. Various ways of writing compatibility are targeted at these browser kernel engines. So what are the current mainstream browser cores?

# The four mainstream browsers on the market

# ie

The browser kernel used by Trident (four The processing speed is the slowest among large cores)

Due to the share of the window market, IE browser has used its position to create a situation where the Trident kernel is the only one. Because of this situation, Microsoft has not dealt with it for a long time. Trident has been updated. Trident has been out of touch with W3C standards and has a large number of bugs and security issues that cannot be solved, which directly led to the rise of the FireFox browser. However, due to its market share, the most troublesome compatibility issue for front-end development engineers now is for some lower versions of IE.

FireFox

The browser kernel used is Gecko

Open source code, fast operation and processing speed. Open source things are always easy to be welcomed by the majority of apes! And there are many browsers that use Gecko, usually used in some foreign browsers. Don’t think too much about it domestically!

Opera

## This browser kernel is Presto

The most fierce brutal interpretation engine! Web page layout engine. It has been highly optimized to increase the rendering speed. To put it simply, it is all about efficiency and speed. But there are gains and losses, and speed is gained at the expense of compatibility. Needless to say, it is the fastest parsing javascript among all browser cores. But now, because the front-end is developing so fast, user experience is the priority in everything, and compatibility cannot be sacrificed for speed. Opera stopped presto and switched to Google's Blink kernel.

Chrome

The browser kernel used is webkit rendering engine javascript v8 interpretation engine

Everything that should be said has been explained above. No further explanation here. This is also the core of the Chrome browser, a browser that many people have begun to learn about front-end and front-end engineers prefer. It is Apple's own core.

# Shell browser :

Use IE kernel instead of IE browser. This kind of browser is called "shell browser". The reason for this is that Trident is an open kernel, so a large number of such shell browsers have appeared in the domestic market. For example, 360, Tencent TT, Cheetah, and Aoyou use dual-core or even multi-core methods. One of them is a Trident core, and other cores are added to the others. Domestic browser manufacturers generally divide this situation into two types, "high-speed browsing mode" and "compatible browsing mode" for users to switch back and forth. Among them, IE kernel Trident is "compatible browsing mode" because domestic manufacturers The applied IE kernel version is not very high and cannot keep up with Trident's iterative update speed. The lower version of the IE kernel is too small and convenient for users to download. Therefore, it has been widely bundled, installed and used since the beginning of development. Until now, there will be certain security problems.

As rated by many issues above, solve and cognition step by step. We know what an interpreted language is and what a compiled language is. I got to know the browser kernel through interpreted languages. Some of the differences between them are closely related to the process of writing code. In the process of learning the web front-end or in the process of constantly improving yourself, understanding and knowing JavaScript must be the most important. In the development process of JavaScript, perhaps many friends thought before that it was necessary to study JavaScript with concentration? From now on, if someone consults you and wants to learn a language or master a new language, you need to recommend JavaScript to him. It must be JavaScript. From the emergence of jQuery, which first drove the development of javascript, to html5, which made javascript truly accessible to people, and now to nodejs. It completely subverts most people's previous views on JavaScript. The emergence of these new frameworks gives JavaScript true unlimited potential!

HTML5 is the advanced content of JavaScript. But some optimizations have been done and some new tags have been added. The new tags are not difficult to understand and easy to use. Why are they defined as the basic part of html? The real power of HTML5 is that you can create tags through JavaScript and use the two characteristics of the kernel to interpret and render respectively. Canvas is also well-known because of its powerful functions, including animation, special effects, games, and data. visualization. All require javascript and background support to have their effect. All thanks to javascript. webgl supports HTML5 canvas drawing 3D image effects. The geographical location expenditure of html5 is displayed in the browser through LBS applications and so on. The connection between javascript and document database has achieved too many impossibilities. The ECMAscript version is constantly iteratively updated, and there are too many js frameworks based on it, such as vuejs, angularjs, reactjs...

The above is the detailed content of From basics to proficiency-javascript 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
JavaScript and the Web: Core Functionality and Use CasesJavaScript and the Web: Core Functionality and Use CasesApr 18, 2025 am 12:19 AM

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding the JavaScript Engine: Implementation DetailsUnderstanding the JavaScript Engine: Implementation DetailsApr 17, 2025 am 12:05 AM

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python vs. JavaScript: The Learning Curve and Ease of UsePython vs. JavaScript: The Learning Curve and Ease of UseApr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python vs. JavaScript: Community, Libraries, and ResourcesPython vs. JavaScript: Community, Libraries, and ResourcesApr 15, 2025 am 12:16 AM

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

From C/C   to JavaScript: How It All WorksFrom C/C to JavaScript: How It All WorksApr 14, 2025 am 12:05 AM

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

JavaScript Engines: Comparing ImplementationsJavaScript Engines: Comparing ImplementationsApr 13, 2025 am 12:05 AM

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

Beyond the Browser: JavaScript in the Real WorldBeyond the Browser: JavaScript in the Real WorldApr 12, 2025 am 12:06 AM

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.

Building a Multi-Tenant SaaS Application with Next.js (Backend Integration)Building a Multi-Tenant SaaS Application with Next.js (Backend Integration)Apr 11, 2025 am 08:23 AM

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing

See all articles

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 Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

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.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor