DMX
DMX
function trim(str, type) { var t = type || "all"; var map = { all: /\s+/g, // 去除字符串所有空格 \s空白字符串 g 修饰符 表示 执行全局匹配(查找所有匹配而非在找到第一个匹配后停止) before: /^\s*/, // 去除字符串前面的空格 \s空白字符串 ^\s表示 以...
test({1: 222, 2: 123, 5: 888}); function test(ob) { var res = []; for (var i = 0; i < 12; i++) { ob[i + 1] ? res.push(ob[i + 1])...
我对回调函数的理解就是,定义了一个函数,不去调用他,但是这个函数会在特定时间条件下被调用
function getQueryString(name) { var string = window.location.search.substr(1); if (!string) return; var res = {}; string = string.replace(/&&/g, "&");//将参数中可能存在的 && 替换为统一的 & string.split("&").forEach(function (item) { var temp = item.split("="); res[temp[0]] =...
function caseConvert(str) { return str.replace(/([a-z]*)([A-Z]*)/g, function (str, sub1, sub2) { return sub1.toLocaleUpperCase() + sub2.toLocaleLowerCase(); })
> There is two-way communication between host and web component via web component's properties and events. If this doesn't answer your question, please elaborate more what you want to achieve....
@PrimaMateria Can you help me solve this problem, it is very urgent, thank you very much
> I don't have any knowledge about that, so I am not able to help you. ok,thanks for your reply~
I use custom event to call a method inside the component
**js生成动态密文** 前端生成的密文虽然谈不上安全,但是可以用于混淆文本,防止一些参数被猜到. 特点: 每次生成的密文都不一样,解密后的文本一样 原理: 加密: 将字符串中的字符拆分成数组并将其转为字符的八进制Unicode码->反序->分割字符串->在字符串中随机加入小写字母,将分割符替换为随机大写字母 这样最终生成了 由数字/小写字母/大写字母的 动态密文 解密: 去掉小写字母->将大写字母替换为一个分割符并用分割符 拆分字符串为数组->反序->将八进制Unicode码转字符串->将数组合并成字符串 使用场景: 隐藏一些不想让用户直接看见的参数, 比如 url中的 id 等参数,cookies中的信息等 生活使用: 也可将自己常用的密码加密后保存在电脑上,避免密码被直接暴露. //加密 function encodeStr(str) { if (!str) return; var random...