当前位置:网站首页>Leak detection and vacancy filling (V)
Leak detection and vacancy filling (V)
2022-04-23 06:51:00 【KK should continue to work hard】
Leak filling ( 5、 ... and )
box-sizing attribute
Applicable scenario :
.wrapper{
width: 300px;
height: 200px;
}
.wrapper div{
float: left;
width: 50%;
padding: 10px;
// Two boxes float ,width Each half , But because of padding, The width of the child container has exceeded half of that of the parent container , At this time, the sub container will fold
//box-sizing: content-box;
// Use border-box Attribute auto adjustment
box-sizing: border-box;
}
<div class="wrapper">
<div>A</div>
<div>B</div>
</div>
- content-box( The default value is ): Set the width of a box model / Height , If this box has border、padding, It will not affect the set width / Height ;
- border-box: Set the width of a box model / Height , If this box has border、padding, Now the width and height of this box is : Set the width / Height -border-padding;
- inherit: Inheriting from the parent element box-sizing
DOM Tree And render Tree The difference between
html After parsing, generate DOM Tree, In the build DOM Tree Render when render Tree, The renderer calculates node style information . The parent node is created before the child node render Tree, When destroying, the child node is destroyed before the parent node render Tree.
If the element is set to display: none Property does not create the corresponding render Tree, however visibility:hidden Will create
DOM Tree And html Elements correspond one to one ,render Tree No, header And hidden elements
Boxing and UnBoxing
- Packing :js The basic data type in is not an object , There is no way , But for example, string can also call many corresponding string methods , This is because js Internally, the basic data type will be converted to the corresponding reference data type , Call the corresponding method on the instance , Then automatically destroy the object
- Unpacking : Convert the reference type object to the corresponding value type object , adopt valueOf()、toString() How to unpack
- When will unpacking and packing conversion be carried out : Basic data type data and reference data type data will be boxed if they need to be converted / Unpacking operation , for example : Double equal sign 、 All in one
Comparison operator (==)
The comparison operator performs automatic type conversion
- Comparison between object type and basic data type , The object type is converted to the basic data type ( Unpacking ,valueOf) After object conversion, it is still an object , After array conversion, it is still an array ;
- Compare string type with number type , String will be converted to numeric type ;
- Boolean types are compared to other types , Boolean types are converted to numeric types 0、1 Compare with other types ;
- null==undefined, In addition, they are no longer equal to any basic data type
- NaN == NaN by false
All equal to (===)
Existing comparative value ( Address ) And compare types
- If the types are different ,false
- null === null by true
- undefined === undefined by true
- Reference data types compare values, addresses, and types
- true === true by true
- false === false by true
- Number Type comparison value , If the value is NaN,NaN Not equal to any value
- Strings compare both values and types
parseInt
Parse the string according to the format at the beginning of the string , The parsing rules are as follows :
- With “0x” start , Parse the rest into hexadecimal integers ;
- With “0” start , Parse the rest into octal or hexadecimal integers ;
- With “1-9” start , Resolve to decimal integer
XSS
- Cross-site scripting attacks , Exploit the loopholes left by web development to insert script Code and execute to attack ;
- XSS The attack requires the server to protect the interface
content-type
The content type actually returned by the client
- application/x-www-form-urlencoded:post The most common way to submit , With key1=value1&key2=value2 The format of ;
- multipart/form-data:post Data submission method ,form Form submission ectyped Definition ,form Upload must be changed to this value ;
- application/json: The format of sending data to the background must be json character string , When passing complex data , Use the data as JSON.stringify() Convert to string , It must trigger cors Pre inspection ;
- application/xml and text/xml:xml Formatted data
版权声明
本文为[KK should continue to work hard]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230551363774.html
边栏推荐
猜你喜欢
随机推荐
C# Dapper 基本使用 增删改查事务等
JS实现网页轮播图
C# webpai 路由详解
FOC SVPWM function pwmc_ Setphasevoltage parsing
Header内置对象
sqlserver性能优化建议
Parse PSD files and map them into components
.Net Core 下使用 Quartz —— 【2】作业和触发器之初步了解作业
js面试题:fn.call.call.call.call(fn2) 解析
数据可视化进一步学习
ES6新增方法
条形码与二维码的生成
微信小程序
useCenterHook
EF CORE在ASP.NET CORE项目中基于数据库优先模式生成实体模型
ECMAScript历史
Use of shell scripts & and 𞓜
Database programming of node
【ORACLE与mysql的区别】
Promise(三)