会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
85455
博客园
首页
新随笔
联系
订阅
管理
2021年10月5日
获取扫码枪扫描的结果
摘要: let lastTime='' let code='' let timer=null document.addEventListener('keydown',(e)=>{ let thisTime=new Date().getTime() if(!lastTime){ lastTime=thisTi
阅读全文
posted @ 2021-10-05 16:12 85455
阅读(209)
评论(0)
推荐(0)
2021年7月24日
类数组和Array.from
摘要: 类数组有哪些1,特殊的object,必须有length属性,相当于数组的长度,所以length需要是大于0的整数, 属性需要是数字或者数字字符串也可以2,getElementByTagName获取到的元素集合也是个类数组3,arguments对象也是一个类数组将类数组转化成真正的数组1.Array.
阅读全文
posted @ 2021-07-24 18:58 85455
阅读(89)
评论(0)
推荐(0)
数组添加n个相同的元素
摘要: arr.push(...new Array(n).fill(item))
阅读全文
posted @ 2021-07-24 10:43 85455
阅读(403)
评论(0)
推荐(0)
2021年7月23日
localeCompare函数
摘要: 比较两个字符串
阅读全文
posted @ 2021-07-23 21:16 85455
阅读(36)
评论(0)
推荐(0)
2020年4月1日
实现跨域的几种方法
摘要: 1.jsonp javascript标签src实现,只能发送get请求 2.cors 需要后台配置允许跨域 3.服务器代理 vue.config.js中配置跨域 devServer: { proxy: { // detail: https://cli.vuejs.org/config/#devser
阅读全文
posted @ 2020-04-01 21:04 85455
阅读(130)
评论(0)
推荐(0)
多页面之间通讯
摘要: 1.window.addEventListener('storage',function(event){ }) window绑定storage事件,当localstorage中的只发生改变的时候触发 2.通过cookie+setInterval实现 3.websocket实现 4.sharedWor
阅读全文
posted @ 2020-04-01 17:24 85455
阅读(215)
评论(0)
推荐(0)
2020年3月31日
js区分ios和android
摘要: <script type="text/javascript"> var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isiOS
阅读全文
posted @ 2020-03-31 23:20 85455
阅读(600)
评论(0)
推荐(0)
手机端兼容问题
摘要: 1.禁止图片点击放大 img { pointer-event:none } 2.禁止ios识别长串数字为电话 <meta name="format-detection" content="telephone=no" /> 3.禁止复制选中文本 -webkit-user-select:none 4.上
阅读全文
posted @ 2020-03-31 23:14 85455
阅读(142)
评论(0)
推荐(0)
Vue路由重写# 与 Web服务器路由重写双配置实现路由重写
摘要: 前言vue路由组件我使用的vue-routerweb服务器使用nginx Vue-router配置vue-router 默认 hash 模式 —— 使用 URL 的 hash 来模拟一个完整的 URL,于是当 URL 改变时,页面不会重新加载http://localhost:8080/#/Hello
阅读全文
posted @ 2020-03-31 22:22 85455
阅读(809)
评论(0)
推荐(0)
前端操作cookie
摘要: 设置cookie: document.cookie='name=zhangsan' document.cookie='age=18' 获取cookie document.cookie // name=zhangsan; age=18
阅读全文
posted @ 2020-03-31 22:20 85455
阅读(922)
评论(0)
推荐(0)
下一页
公告