上一页 1 2 3 4 5 6 7 ··· 21 下一页

2022年9月11日

跨端兼容,条件编译;#ifedf与#endif

摘要: // #ifedf H5 和 // #endif 必须成对出现 注意注释方式不同 ###template中 <!-- #ifedf H5 --> <view>只在H5页面中显示</view> <!-- #endif --> <!-- #ifedf MP-WEIXIN --> <view>只在微信小程 阅读全文

posted @ 2022-09-11 00:55 In-6026 阅读(75) 评论(0) 推荐(0) 编辑

2022年9月9日

面试题

摘要: ##浏览器篇 ####从输入URL到浏览器显示页面过程中都发生了什么 1. 发送至 DNS 服务器并获得域名对应的 WEB 服务器的 ip 地址 2. 通过Cache-Control和Expires来检查是否命中强缓存,命中就从本地磁盘/缓存中取html(200 from disk cache) 3 阅读全文

posted @ 2022-09-09 00:46 In-6026 阅读(79) 评论(0) 推荐(0) 编辑

2022年9月8日

两个非同源页面之间通信,postMessage

摘要: ####http://127.0.0.1:3000/a.html <iframe id="frame" src="http://127.0.0.1:3001/b.html"></iframe> <script> iframe.onload = function() { iframe.contentW 阅读全文

posted @ 2022-09-08 02:10 In-6026 阅读(186) 评论(0) 推荐(0) 编辑

跨域解决方法

摘要: ##jsonp ####原理:利用了img,link,script,iframe标签都不存在跨域限制的特点,使用script标签传递函数 ####大致步骤:前端把一个函数(func)传递到后端,后端做字符串拼接,得到 "func('一段文字')" 的字符串,发送回前端后,前端就会执行 func('一 阅读全文

posted @ 2022-09-08 02:03 In-6026 阅读(22) 评论(0) 推荐(0) 编辑

2022年9月5日

新安装的Hbuilderx可能经常报这个错,FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

摘要: 据网友所言:这是因为Hbuilder自带的nodejs版本低,所以内存溢出 如果电脑上有node的话就把如下文件直接粘贴过来,把hbx的node文件替换掉 两个npm,两个npx名字的文件,和node.exe 以新版node的同名文件覆盖 ###接下来可能遇到这个问题: [编译scss/sass] 阅读全文

posted @ 2022-09-05 23:56 In-6026 阅读(818) 评论(0) 推荐(0) 编辑

2022年8月18日

overflow需要再css上设置,再标签上overflow='visible'无效

摘要: <path d="M 0 0 L 200 0 ...." stroke-width="2" /> 这种情况会有一般的边框超出svg,导致显示不全,需要设置overflow='visible',但要在css里设置才有效 如标题 阅读全文

posted @ 2022-08-18 15:56 In-6026 阅读(145) 评论(0) 推荐(0) 编辑

2022年7月3日

mouseDown,mouseMove,mouseUp更好的实践

摘要: ###不好的实践,move 不能太快,否则会监听不到 let flag = false document.addEventListener('mousedown', down) document.addEventListener('mousemove', move) document.addEven 阅读全文

posted @ 2022-07-03 02:30 In-6026 阅读(45) 评论(0) 推荐(0) 编辑

2022年6月24日

判断元素是否将要出现在可视区域 ele.getBoundingClientRect().top

摘要: 这种要实时监听.getBoundingClientRect().top <div></div> 1. 获取可视区域高度 height = document.body.offsetHeight 2. 获取元素距离浏览器 body 的 top border的距离 distanceBodyAbove = 阅读全文

posted @ 2022-06-24 02:10 In-6026 阅读(51) 评论(0) 推荐(0) 编辑

2022年6月23日

meta标签

摘要: 设置编码方式,不合适的编码方式可能导致乱码,一般都是用utf-8 <meta charset="utf-8"> 设置关键字,为搜索引擎提供关键字,方便被搜索到 <meta name="keywords" content="手表,购物,手机,服装" > 添加对网页的描述 <meta name="des 阅读全文

posted @ 2022-06-23 00:36 In-6026 阅读(15) 评论(0) 推荐(0) 编辑

2022年6月22日

防抖/节流

摘要: ##防抖 防抖是,用户频繁触发事件(如:oninput/onscroll),但是只要最后一次,等用户输入完 / 滚完,就只执行最后一次 初稿 let timer = null input.oninput = function() { if(timer !== null) { clearTimeout 阅读全文

posted @ 2022-06-22 22:16 In-6026 阅读(26) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 21 下一页

导航