!! | |||||||||||||||||||||||||
utf8_unicode_ci和utf8_general_ci | |||||||||||||||||||||||||
计算运行时间(性能) | |||||||||||||||||||||||||
width: 100%的应用 | |||||||||||||||||||||||||
nth-child和nth-of-type的区别 | |||||||||||||||||||||||||
document.addEventListener | |||||||||||||||||||||||||
offsettop的问题 | |||||||||||||||||||||||||
在手机上测试网页遇到的问题 | |||||||||||||||||||||||||
什么是Unicode,什么是UTF-8 | |||||||||||||||||||||||||
手机屏幕分辨率和手机浏览器分辨率 | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
!! | |||||||||||||||||||||||||
类型转换 将对应的类型转换为boolean型 !!b指的是将b转换为boolean值 去两次非是因为将b转换位boolean值后取了一次非,所以得到的值正好相反,再取一次反回来 | |||||||||||||||||||||||||
utf8_unicode_ci和utf8_general_ci | |||||||||||||||||||||||||
具体的说: 1、对于一种语言仅当使用utf8_unicode_ci排序做的不好时,才执行与具体语言相关的utf8字符集校对规则。例如,对于德语和法语,utf8_unicode_ci工作的很好,因此不再需要为这两种语言创建特殊的utf8校对规则。 2、utf8_general_ci也适用与德语和法语,除了‘?’等于‘s’,而不是‘ss’之外。如果你的应用能够接受这些,那么应该使用 utf8_general_ci,因为它速度快。否则,使用utf8_unicode_ci,因为它比较准确。 用一句话概况上面这段话:utf8_unicode_ci比较准确,utf8_general_ci速度比较快。通常情况下 utf8_general_ci的准确性就够我们用的了,在我看过很多程序源码后,发现它们大多数也用的是utf8_general_ci,所以新建数据 库时一般选用utf8_general_ci就可以了 | |||||||||||||||||||||||||
计算运行时间(性能) | |||||||||||||||||||||||||
使行属性标签既可以设置宽高,又可居中 =============================== span{ width:85px; height:24px; display: inline-block; } //父级 #main span{ Width: 100%; text-align: center; } | |||||||||||||||||||||||||
nth-child和nth-of-type的区别 | |||||||||||||||||||||||||
els:nth-child(n) 1.往上找父级 2.父级下的第n个元素若为els======选中 els:nth-of-type(n) 往上找父级,父级下的第n个els元素=======被选中 zero In the above example, .demo li:nth-child(2) selects the | |||||||||||||||||||||||||
document.addEventListener | |||||||||||||||||||||||||
1. Bubbling and sinking document.addEventListener("Event name", function, false); addEventListener determines the response order of the event; -----If it is true, the event execution order is addEventListener -> label’s onclick event-> document.onclick (sinking) -- ---If false tag's onclick event -> document.onclick -> addEventListener (bubble)
Understood as the calling entrance of other codes 2.Solve the problem of letting a js event execute multiple times function document.onclick=function (){ alert('a'); } document.onclick=function (){ alert('b'); } --->Only output b ****** ************ document.addEventListener("click", function (){ alert( 'a'); }, false); document.addEventListener("click",function (){ alert('b'); },false); --->Output a,b 3.Summary true The triggering order is always before false; If multiple are true, the outer layer is triggered before the inner layer; If If multiple values are false, the inner layer is triggered before the outer layer.
| |||||||||||||||||||||||||
|
Response order: White blocks: 2 Green blocks: 1 Yellow blocks : 3 | ||||||||||||||||||||||||
White block: 1 Green block : 2 Yellow block: 3 | |||||||||||||||||||||||||
White block : 3 Green blocks: 2 Yellow blocks: 1 | |||||||||||||||||||||||||
White blocks: 2 Green blocks: 3 Yellow blocks: 1 | |||||||||||||||||||||||||
Related information: js event bubbling and event capturing | |||||||||||||||||||||||||
Offsettop problem
| |||||||||||||||||||||||||
1.The parent border does not count 2.offsettop is a relative positioning | |||||||||||||||||||||||||
Problems encountered when testing web pages on mobile phones
| |||||||||||||||||||||||||
1.First turn off the firewall on your computer 2.Check if there is any anti-virus software on the machine. The same thing happened to me. There is an ESET on my machine. Turn off the firewall settings above 3 .Check if your computer allows access to port 80 | |||||||||||||||||||||||||
What is Unicode and what is UTF-8
| |||||||||||||||||||||||||
What is Unicode Universal Multiple-Octet Coded Character Set,abbreviated as UCS . Unicode (Unicode, Universal Code, Unicode) is a character encoding used on computers. Unicode is a character encoding scheme developed by international organizations that can accommodate all texts and symbols in the world. Unicode uses the numbers 0-0x10FFFF to map these characters, which can accommodate up to 1114112 characters, or 1114112 code points. A code point is a number that can be assigned to a character. UTF-8, UTF-16, and UTF-32 are all encoding schemes for converting numbers into program data. Chinese range 4E00-9FBF
What are UCS-2 and UCS-4 UCS-2 is encoded with two bytes, and UCS-4 is encoded with 4 bytes. UCS-2 Also known as Basic Multilingual Plane. UCS-2Converting to UCS-4 is simply adding 2 bytes of 0 in front.
What is UTF-8 UTF is " UCS Transformation Format" abbreviation, which can be translated into Unicode character set conversion format.
| UnicodeEncoding (hex ) |
| UTF-8
|
(binary ) UTF-8 Features It uses different length encodings for different ranges of characters.
For characters between 0x00-0x7F, UTF-8 encoding is exactly the same as ASCII encoding. The maximum length of UTF-8 encoding is 4 bytes. As can be seen from the above table, the 4-byte template has 21 x's, which means it can accommodate 21 binary digits. The maximum code point of Unicode, 0x10FFFF, is only 21 bits.
Mobile screen resolution and mobile browser resolution Mobile phone screen resolution When making mobile applications: @media screen and (min-device-width:640px) and ( max-device-width:960px) Mobile browser resolution @media screen and (min-width:320px) and ( max-width:480px) document.write("The browser resolution is " document.documentElement .clientWidth "*" document.documentElement.clientHeight ); document.write("The screen resolution is " window.screen.width "*" window. screen.height); |