I have read the book "JavaScript Advanced Programming" several times before, but I have never read it completely. From now on, I will read it completely and record notes and my own thoughts on each chapter. Come on!
Since the content of the first three chapters is relatively simple, I will put them into one chapter to record the learning process.
1. Basic concepts
1. The relationship between JavaScript and ECMAScript
It can be understood that in addition to ECMAScript, JavaScript contains Also includes DOM (Document Object Model), BOM (Browser Object Model)
2, <script> tag</script>
Attributes: async defer charset type src
The difference between defer and async: (only applicable to external script files)
Without async or defer, the <script> tags are parsed in sequence. The browser will load and execute the specified script immediately. "Immediately" refers to before rendering the document element under the <code>script tag. That is to say, it does not wait for subsequent loading of document elements. Load and execute. </script>
With async, the process of loading and rendering subsequent document elements will be carried out in parallel with the loading and execution of js (asynchronously);
With defer, the process of loading subsequent document elements will be parallel with the loading of js Proceed in parallel (asynchronous), but the execution of js must be completed after all elements are parsed and before the DOMContentLoaded event is triggered
The blue line represents network reading, and the red line represents Execution time, both are for scripts; the green line represents HTML parsing.
Click for detailed analysis
- ## Tag position: can be placed behind the content in the or element
- Document mode: (can be divided into mixed mode and standard mode)
The difference between browser mode and document mode in IE:Browser mode: It affects the browser version and IE’s conditional comments. Document mode: It affects IE’s layout engine and DOM rendering. Click for detailed analysis3. Data type 5 simple data types: String, Number, Boolean, Null, Undefined 1 complex data type: Object The typeof operator detects the variable Data type, return string
Note: typeof null returns 'object', null is considered an empty object reference
When the variable is not initialized or declared, typeof All return undefined ----- Boolean typeConvert to true value | Value converted to false | |
true | false | |
Non-empty string | Empty string | |
Any non-zero numeric value (including infinity) | 0 and NaN | |
Any object | null | |
Not applicable | undefined |
The above is the detailed content of Lecture 1 of 'Advanced Programming with JavaScript' -- Basic Concepts. For more information, please follow other related articles on the PHP Chinese website!

js字符串转数组的方法:1、使用“split()”方法,可以根据指定的分隔符将字符串分割成数组元素;2、使用“Array.from()”方法,可以将可迭代对象或类数组对象转换成真正的数组;3、使用for循环遍历,将每个字符依次添加到数组中;4、使用“Array.split()”方法,通过调用“Array.prototype.forEach()”将一个字符串拆分成数组的快捷方式。

js中new操作符做了:1、创建一个空对象,这个新对象将成为函数的实例;2、将新对象的原型链接到构造函数的原型对象,这样新对象就可以访问构造函数原型对象中定义的属性和方法;3、将构造函数的作用域赋给新对象,这样新对象就可以通过this关键字来引用构造函数中的属性和方法;4、执行构造函数中的代码,构造函数中的代码将用于初始化新对象的属性和方法;5、如果构造函数中没有返回等等。

Java爬虫初探:了解它的基本概念与用途,需要具体代码示例随着互联网的快速发展,获取并处理大量的数据成为企业和个人不可或缺的一项任务。而爬虫(WebScraping)作为一种自动化的数据获取方法,不仅能够快速地收集互联网上的数据,还能够对大量的数据进行分析和处理。在许多数据挖掘和信息检索项目中,爬虫已经成为一种非常重要的工具。本文将介绍Java爬虫的基本概

这篇文章主要为大家详细介绍了js实现打字小游戏,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。

php在特定情况下可以读js内部的数组。其方法是:1、在JavaScript中,创建一个包含需要传递给PHP的数组的变量;2、使用Ajax技术将该数组发送给PHP脚本。可以使用原生的JavaScript代码或者使用基于Ajax的JavaScript库如jQuery等;3、在PHP脚本中,接收传递过来的数组数据,并进行相应的处理即可。

js全称JavaScript,是一种具有函数优先的轻量级,直译式、解释型或即时编译型的高级编程语言,是一种属于网络的高级脚本语言;JavaScript基于原型编程、多范式的动态脚本语言,并且支持面向对象、命令式和声明式,如函数式编程。

js原生选择器有getElementById()、getElementsByClassName()、getElementsByTagName()、querySelector()和querySelectorAll()等。详细介绍:1、getElementById()通过元素的唯一标识符来选择元素,它返回具有指定ID的元素作为结果等等。

从零开始:掌握5个Java工作流框架的基本概念与用法引言在软件开发领域,工作流是一种重要的概念,用于描述和管理复杂的业务流程。Java作为一种广泛应用的编程语言,也有许多优秀的工作流框架供开发者选择。本文将介绍5个Java工作流框架的基本概念与用法,帮助读者快速上手。一、ActivitiActiviti是一个开源的BPM(BusinessProcessM


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

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

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.

Zend Studio 13.0.1
Powerful PHP integrated development environment
