当前位置:网站首页>Niuke JS wrong question knowledge point record
Niuke JS wrong question knowledge point record
2022-06-11 07:51:00 【AQ14_】
plus + The definition of
about “+” Come on , There are two meanings : The first meaning is string splicing , The second meaning is addition in addition and subtraction .
1, If one of the operands is a string , Other values will be converted to strings ;
2, Other situations , Operands are converted into numbers to perform addition operations .
And for “ - ” Come on , There is only one meaning , It's subtraction , Naturally, it will not be converted into a string .
web Page lifecycle
The loading sequence of general browsers is as follows :
- script executed
- readyState : interactive
- DOMContentLoaded
- image onload
- iframe onload
- readyState : complete
- window onload
summary :
synchronous JavaScript Script executes first , It precedes DOMContentLoaded Event to perform .
When DOM When ready ,DOMContentLoaded The incident happened in document Trigger on . Can be used at this stage JavaScript To operate DOM Elements .
All scripts have been executed , Except for those external uses of asynchrony (async) Or delay (defer) Loaded script Images and other resources may still be loading .window Upper onload event , Trigger after all resources are loaded on the page . Most of the operations we should put in DOMContentLoaded In the event , Instead of putting it in window.onload In the implementation of , Because the usual operations don't have to wait until the end .
window Upper beforeunload event , This event occurs when the user is ready to leave the page , stay unload Triggered before the event . If beforeunload Returns a string , The browser will give a prompt whether the user really wants to leave .
window Upper unload event , This event will be triggered when the user finally leaves . stay unload In the event handler of , We can only do simple things , It does not involve delaying or asking the user . Because of this limitation , It's rarely used .
document.readyState Indicates the current status of the document , Can be in readystatechange Event to track changes in document status .
loading – Document loading . interactive – document Triggered when the resolution has been completed , Almost DOMContentLoaded At the same time , But in DOMContentLoaded Triggered before the event . complete – Triggered when the document and resources are loaded , Almost window.onload At the same time , But in onload Triggered before the event .
Factors leading to backflow
- Resize window , Browser window size changed ——resize Event time
- Element size change —— Margin 、 fill 、 Frame 、 Width and height ; Change font size
- Page rendering initialization
- Element position changes
- Style sheet changes
- Element content changes , Especially the input control
- CSS Pseudo class activation
- DOM operation , Add or remove visible DOM Elements
- offsetWidth, width, clientWidth, scrollTop/scrollHeight The calculation of ,
Will cause the browser to gradually return to the queue Flush, Perform backflow immediately . - Content change —— For example, the width and height of the calculation value caused by the change of the text or the size of the picture
边栏推荐
- Uoj 554 [unr 4] challenges Hamilton [find Hamilton path (adjustment method)]
- 模线性方程组(中国剩余定理+通用解法)
- Sort - merge sort
- Zero foundation self-study SQL course | union joint query
- Lesson 1 about Xiaobai's C language
- Three expressions of integers and their storage in memory
- [atcoder2305] declining (game)
- multi-sig SC
- [atcoder1984] wide swap
- 排序——归并排序
猜你喜欢

Paging of the flask page

Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np

Alchemy experience (model training of deep learning) the necessity of timely adjusting training parameters for some situations (the adjustment of learning rate LR is the primary) summarizes some metho

forEach 中 return 和 for 中 break

Simple configuration of vscade

Lesson 1 about Xiaobai's C language

2. Graduated from this course, and the bank has outsourced testing work for more than 4 months. Talk about some real feelings

C# 微信上传Form-data

The solution of "no startup device" after running Bochs
![20200803 T3 my friends [divide and conquer NTT optimization recursion]](/img/35/01201e3136e3dd5cd562a0481f1ee9.jpg)
20200803 T3 my friends [divide and conquer NTT optimization recursion]
随机推荐
Bladed入門教程(視頻)
【AtCoder1998】Stamp Rally(整体二分+并查集)
零基础自学SQL课程 | UNION 联合查询
C# 微信上传Form-data
Uoj 553 [unr 4] caproic acid set [computational geometry (points in circle → points in half plane)]
20200803 T3 my friends [divide and conquer NTT optimization recursion]
Uoj 551 [unr 4] campus stroll [good polynomial questions (FOG)]
【软件测试】这样的简历已经刷掉了90%的面试者
[IOT] intelligent hardware: how to obtain the WiFi signal strength of hardware products
JSP development model
Zero foundation self-study SQL course | outer join external connection
空间几何
Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np
How to prepare for the new PMP syllabus exam?
Figure seamless database integration tushare interface
[atcoder2305] declining (game)
[software testing] 90% of the interviewers have been brushed out of such resumes
欧拉定理及扩展(附证明)
批量拼接字符串
代码设置ConstraintLayout的layout_constraintDimensionRatio