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