function versions(params) { var u = navigator.userAgent; return { trident: u.indexOf('... 【JS】判断设备是不是移动端或者其他设备 8个月前 (08-18) 191 0
var str = "https://www.baidu.com/"; var reg = /^http(s|):\/\/\S*?\// var domainName = str.match... 【JS】正则表达式获取url中的域名 8个月前 (08-18) 182 0
html 转义加密解密 html加密 let htmlEscape = function html2Escape(str) { return str.replace(/... 置顶 · 【JS】数据处理方法块 9个月前 (07-11) 241 0
eval('[[1,4,5],[23,54,75],[45,67,8]]') 【JS】将字符串的数组转为正常的数据'[[1,4,5],[23,54,75],[45,67,8]]' 9个月前 (07-01) 165 0
document.location.host //表示当前域名 + 端口号 document.location.hostname //表示域名 doc... 【JS】判断当前协议是http还是https 11个月前 (04-28) 206 0
html加密 let htmlEscape = function html2Escape(str) { return str.replace(/[<>&"]/g, ... 【JS】html 转义加密解密 1年前 (2022-02-18) 287 0
情况: let num = 409600; let total = 433927; let percentData = (num / total).toFixed(3) * 100; ... 【JS】toFixed方法设置小数点位数后再进行计算,数据出错问题 1年前 (2022-02-16) 266 0
encodeURIComponent() 对 URI 进行编码 var uri="https://www.test.com/test?name=test&car=car"; ... 【JS】decodeURIComponent()和encodeURIComponent() 1年前 (2022-02-15) 258 0
export 导出: export let str = “hello”; export function myFun(){}; 导入: import { str, my... 【ES6】export及export default的区别 1年前 (2022-02-11) 232 0
function conver(limit){ var size = ""; if(limit === 0) return '0MB' return (limit... 【JS】单位B大小转化MB的转化方法 1年前 (2022-01-07) 307 0
startsWith() 方法 var str = "Hello world, welcome to the Runoob."; var n = str.startsWith("He... 【JS】查看字符串是否为 "Hello" 开头 1年前 (2022-01-07) 280 0
function copyText(content){ if(content){ const input = document.createElement('inpu... 【JS】复制文字 1年前 (2021-12-10) 290 0