js
肖恩啊
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
页面跳转的几种方法
页面跳转的几种方法window.locationwindow.location.href=url;window.location.assign(url) //当前页面跳转,会存到历史列表中window.location.replace(‘url’) //当前页面跳转,不会存到历史列表中window.open() //新开页面,有些浏览器会拦截也可以用vue-router th...原创 2018-03-15 17:25:33 · 588 阅读 · 0 评论 -
类数组转数组
伪数组也称类数组。像arguments 或者 获取一组元素返回的集合都是伪数组。1.声明一个空数组,通过遍历伪数组把它们重新添加到新的数组中 function toArray(a) { let arr = []; for (let i = 0; i < a.length; i++) { arr[arr.leng...原创 2018-03-16 15:06:53 · 237 阅读 · 0 评论 -
浏览器支持base64编码
从IE10+浏览器开始,所有浏览器就原生提供了Base64编码解码方法,不仅可以用于浏览器环境,Service Worker环境也可以使用。方法名就是atob和btoa,具体语法如下:解码:语法为(浏览器中):var decodedData = window.atob(encodedData);或者(浏览器或js Worker线程中):window.atob('YmFpZG...转载 2018-08-07 11:27:07 · 2075 阅读 · 0 评论
分享