![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
肖恩啊
这个作者很懒,什么都没留下…
展开
-
页面跳转的几种方法
页面跳转的几种方法 window.location window.location.href=url; window.location.assign(url) //当前页面跳转,会存到历史列表中 window.location.replace(‘url’) //当前页面跳转,不会存到历史列表中 window.open() //新开页面,有些浏览器会拦截 也可以用vue-router th...原创 2018-03-15 17:25:33 · 491 阅读 · 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 · 186 阅读 · 0 评论 -
浏览器支持base64编码
从IE10+浏览器开始,所有浏览器就原生提供了Base64编码解码方法,不仅可以用于浏览器环境,Service Worker环境也可以使用。 方法名就是atob和btoa,具体语法如下: 解码: 语法为(浏览器中): var decodedData = window.atob(encodedData); 或者(浏览器或js Worker线程中): window.atob('YmFpZG...转载 2018-08-07 11:27:07 · 1893 阅读 · 0 评论