标签:als 全选 ott replace att 参数 return UNC value
/* 全选/全不选 */ function selectAll(objSelect) { if (objSelect.checked == true) { $("input[name=‘chkId‘]").attr("checked", true); $("input[name=‘chkAll‘]").attr("checked", true); } else if (objSelect.checked == false) { $("input[name=‘chkId‘]").attr("checked", false); $("input[name=‘chkAll‘]").attr("checked", false); } } /* js 动态移除 head 里的 js 引用 */ this.ClearHeadJs = function (src) { var js = document.getElementsByTagName(‘head‘)[0].children; var obj = null; for (var i = 0; i < js.length; i++) { if (js[i].tagName.toLowerCase() == "script" && js[i].attributes[‘src‘].value.indexOf(src) > 0) { obj = js[i]; } } document.getElementsByTagName(‘head‘)[0].removeChild(obj); }; /*返回字符串长度,汉字计数为2*/ function strLength(str) { var a = 0; for (var i = 0; i < str.length; i++) { if (str.charCodeAt(i) > 255) a += 2;//按照预期计数增加2 else a++; } return a; } 获取url中的参数 function GetQueryStringRegExp(name,url) { var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i"); if (reg.test(url)) return decodeURIComponent(RegExp.$2.replace(/\+/g, " ")); return ""; } /*函数防抖*/ function debounce(func, delay) { let timer return function (...args) { if (timer) { clearTimeout(timer) } timer = setTimeout(() => { func.apply(this, args) }, delay) } } /*函数节流*/ var throttle = function(delay, action){ var last = 0 return function(){ var curr = +new Date() if (curr - last > delay){ action.apply(this, arguments) last = curr } } }
全选全不选,返回字符串长度,汉字计数为2,获取url中的参数 ,函数防抖,函数节流
标签:als 全选 ott replace att 参数 return UNC value
原文地址:https://www.cnblogs.com/caoruichun/p/10520592.html