随笔分类 - js
摘要:引入video.css 和video.js 为前提 调用主要是
阅读全文
摘要:QQ音乐接口播放经常换, 最开始 url: `http://ws.stream.qqmusic.qq.com/${musicData.songid}.m4a?fromtag=46` 然后 url:`http://ws.stream.qqmusic.qq.com/C100${musicData.son
阅读全文
摘要:来自:https://blog.csdn.net/u013239236/article/details/52213977 侵删 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; char
阅读全文
摘要:Object.keys 返回一个所有元素为字符串的数组,其元素来自于从给定的object上面可直接枚举的属性。这些属性的顺序与手动遍历该对象属性时的一致。 // 表单清空 Object.keys(this.formValue).forEach((key) => { this.formValue[ke
阅读全文
摘要:解决方案 可以安装整个stage2的预置器或者安装 Object Rest Operator 的babel插件 babel-plugin-transform-object-rest-spread 。 接着在babel的配置文件 .babelrc 中应用插件: { "presets": [ ["es2
阅读全文
摘要:调用- let obj = [{"name": "1","url": "1u"}, {"name": "1","url": "1r"}, {"name": "2","url": "1u"},{ "name": "1", "url": "1u" }]; console.l
阅读全文
摘要://es6语法export function debounce(func, delay) { let timer //返回一个函数,并拿到参数 return function (...args) { if (timer) { clearTimeout(timer) } timer = setTimeout(() => { func.ap...
阅读全文
摘要://先定义一个某数值范围内的随机数 // 克隆数组方法 //洗牌 //调用
阅读全文
摘要://调用 const transform = prefixStyle('transform') const backdrop = prefixStyle('backdrop-filter') div.style[transform] = `translate3d(0,0,0)` 等同于 div.st
阅读全文
摘要:来自:https://blog.csdn.net/wd4java/article/details/50466633 侵删 以下我们将为大家介绍 JavaScript 保留两位小数的实现方法:四舍五入以下处理结果会四舍五入: ? 1 2 var num =2.446242342; num = num.
阅读全文
摘要:来自:https://blog.csdn.net/qq_37120738/article/details/79086706 侵删 slice() 定义和用法 slice() 方法可从已有的数组中返回选定的元素。 string.slice(start, end)提取一个字符串 string.subst
阅读全文
摘要:来自:http://www.cnblogs.com/fangshidaima/p/5910604.html 侵删 forEach是ES5中操作数组的一种方法,主要功能是遍历数组,例如: 1 2 var arr = [1,2,3,4]; arr.forEach(alert); 1 2 var arr
阅读全文
摘要:addClass(元素, 'item-类名')
阅读全文
摘要:if (window["context"] == undefined) { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + wi...
阅读全文
摘要:var shine=0.8; var arrays = ['[255,182,193,0.8]','[144,238,144,0.8]','[255,235,205,0.8]','[240,128,128,0.8]','[255,186,0,0.8]','[255,225,189,0.8]','[227,229,241,0.8]','[248,228,239,0.8]','[223,237,2...
阅读全文
摘要:https://www.zhangxinxu.com/wordpress/2017/07/js-text-string-download-as-html-json-file/ 侵删 1.H5 download属性 downFile(下载地址, 保存名称); 2.iframe方式 3.form方式
阅读全文
摘要:var tree = [ { name: 'node1' }, { name: 'node2', children: [{ name: 'node-2-1' }, { name: 'node2-2' }] }, { name: 'node3', children: [{ name: 'node-3-1', children: [{ name: 'node3-1-1' }]...
阅读全文