摘要: 1.0 js函数防抖 function debounce(fn, delay = 1000) { let timerId; return function (...args) { clearTimeout(timerId); timerId = setTimeout(() => { fn.apply 阅读全文
posted @ 2026-01-18 21:56 (๑•_•๑) 阅读(10) 评论(0) 推荐(0)
摘要: function SLEEP(t) { return new Promise(function(resolve, reject) { setTimeout(() => { resolve(); }, t) }); }; async function asyncFunc() { console.log 阅读全文
posted @ 2025-05-12 01:47 (๑•_•๑) 阅读(24) 评论(0) 推荐(0)
摘要: CORS将请求分为两类: 1. 简单请求: 请求方法:GET、HEAD、POST 头部字段满足CORS安全规范 请求头Content-Type为 text/plain multipart/form-data appplication/x-www-form-urlencoded 解决方法: 请求头加入 阅读全文
posted @ 2025-01-18 06:52 (๑•_•๑) 阅读(36) 评论(0) 推荐(0)
摘要: 纯CSS实现检测页面滚动位置并展示 /* 注册自定义属性 */ @property --scroll-position { syntax: "<number>"; inherits: true; initial-value: 0; } /* 属性值过渡动画 */ @keyframes scroll- 阅读全文
posted @ 2024-07-12 11:09 (๑•_•๑) 阅读(58) 评论(0) 推荐(0)