摘要: 浏览器自定义事件通信示例 window.addEventListener('hello',(e)=>{ console.log(e.detail) }); window.dispatchEvent(new CustomEvent('hello', {detail:{name:'张三'}})) Nod 阅读全文
posted @ 2020-10-07 21:33 mingL 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 通过location.search可以获取到url拼接的参数(前面带有?号) function getUrlParams(name) { let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); let param = window.l 阅读全文
posted @ 2020-10-07 21:25 mingL 阅读(2011) 评论(0) 推荐(0) 编辑
摘要: //法一 const isArray1=function(value){ return Object.prototype.toString.apply(value) '[object Array]' } //法二 const isArray2=function(value){ return Arra 阅读全文
posted @ 2020-10-07 21:24 mingL 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 原文地址:Understanding the Event Loop, Callbacks, Promises, and Async Await in JavaScript 作者选择了COVID-19救济基金来接受捐赠,这是Write for DOnations计划的一部分。 介绍 在互联网的早期,网 阅读全文
posted @ 2020-10-07 20:34 mingL 阅读(140) 评论(0) 推荐(0) 编辑
摘要: github仓库地址:JS 判断当前终端是Android还是IOS // IOS const isIOS = () => { if (typeof window.navigator.userAgent !== 'string') return false; const u = window.navi 阅读全文
posted @ 2020-10-07 16:03 mingL 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 原文地址:Web Caching Basics: Terminology, HTTP Headers, and Caching Strategies 介绍 智能的内容缓存是改善网站访问体验的最有效方法之一。 缓存或临时存储来自先前请求的内容,是HTTP协议中实现的核心内容交付策略的一部分。 整个传递 阅读全文
posted @ 2020-10-07 00:28 mingL 阅读(152) 评论(0) 推荐(0) 编辑