五分钟搭建个人博客:使用lighbox预览图片

大家好。 今天接着研究个人站长探索之博客搭建。 前阵子来了趟西北环线旅行,写了几天游记,并附上几张图,但图片大小不一,也不能占太多空间,就想着要...

六月 3, 2024 · 2 分钟 · 727 字

从版号排序到手写Sort

给版本号排序 var versions = ['2.0.1', '1.1.0', '1.0.2', '2.0.0', '1.0.0', '3.0.10', '2.1.10', '2.0.0']; versions.sort((a, b) => { const alist = a.split('.'); const blist = b.split('.'); for (let i = 0; i < alist.length; i ++) { if (alist[i] > blist[i]) { return 1; } else if (alist[i] < blist[i]) { return -1; } else { continue; } } return 0; }) sort是...

六月 3, 2024 · 1 分钟 · 217 字

奇怪的知识:js如何判断系统架构

场景:点击按钮下载什么架构的客户端 为啥需要JS判断当前浏览器所属的系统架构?可以代入到场景:如果需要自行分发arm、x86技术架构的客户端安...

六月 3, 2024 · 2 分钟 · 986 字

http相关

三次握手四次挥手 客户端发起请求,携带请求序列号 服务端接收,发送应答,返回请求序列号,携带新的服务序列号 客户端收到应答和对应的请求序列号,发送...

六月 2, 2024 · 5 分钟 · 2006 字

script中的defer和async属性

html.spec.whatwg.org 对属性的描述 The async and defer attributes are boolean attributes that indicate how the script should be evaluated. Classic scripts may specify defer or async, but must not specify either unless the src attribute is present. Module scripts may specify the async attribute, but must not specify the defer attribute. Async 和defer 是用于指示脚本应...

六月 1, 2024 · 3 分钟 · 1236 字