1、求百分比
(one/total*100).toFixed(2)+'%'
2、生成颜色代码
Math.floor(Math.random()*16777215).toString(16)
3、压缩html代码
content.replace('/\\\r?\n/g', '')
1、求百分比
(one/total*100).toFixed(2)+'%'
2、生成颜色代码
Math.floor(Math.random()*16777215).toString(16)
3、压缩html代码
content.replace('/\\\r?\n/g', '')
转载于:https://www.cnblogs.com/Jodie/p/3605343.html