前端大佬都在使用的JavaScript工具函数宝典(内含95个工具函数)
Posted 搬砖之友
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了前端大佬都在使用的JavaScript工具函数宝典(内含95个工具函数)相关的知识,希望对你有一定的参考价值。
= Element.prototype.addEventListener;
NodeList.prototype.= function ( [ el. );
event = event.initEvent(type, event.data = data || ;
event.eventName = type;
event.target = [][ el[ );
text
.replace( .replace( .replace( .replace( s = templateData[ (i = arg = s += arg
.replace( .replace( .replace( s += templateData[i];
s;
html = SaferHTML (!oTarget)
(obj.addEventListener)
obj.addEventListener(evt, fn, (obj.attachEvent)
obj.attachEvent(+ evt, fn);
oTarget[+ sEvtType] = fn;
(e)
(e)
alert(
.match(
/(url\\(|src=|href=)[\\"\\ )
.join( .replace(/^(src=|href=|url\\()[\\"\\ id = hash(src + text);
(!reload && in_array(id, evalscripts)) (reload && $(id))
$(id).parentNode.removeChild($(id));
evalscripts.push(id);
scriptNode = scriptNode.type = scriptNode.id = id;
scriptNode.charset = charset
? charset
: BROWSER.firefox
? :
(src)
scriptNode.src = src;
scriptNode.onloadDone = scriptNode.onload = scriptNode.onloadDone = JSLOADED[src] = ;
scriptNode.onreadystatechange = (
(scriptNode.readyState == ||
scriptNode.readyState == !scriptNode.onloadDone
)
scriptNode.onloadDone = JSLOADED[src] =
;
(text)
scriptNode.text = text;
(e) btn = d = b = btn.style.display = "none";
btn.onclick = function()
btn.style.display = d.scrollTop -= b.scrollTop -= (d.scrollTop + b.scrollTop == clearInterval(btn.timer, ( , 10);
;
function btn.style.display = d.scrollTop + b.scrollTop > ? :
backTop( b64 = o1,
o2,
o3,
h1,
h2,
h3,
h4,
bits,
i = ac = dec = tmp_arr = [];
(!
+=
h1 = b64.indexOf( h2 = b64.indexOf( h3 = b64.indexOf( h4 = b64.indexOf( bits = (h1 << o1 = (bits >> o2 = (bits >> o3 = bits & (h3 == tmp_arr[ac++] = String.fromCharCode(o1);
(h4 == tmp_arr[ac++] = String.fromCharCode(o1, o2);
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
(i < dec = tmp_arr.join( dec = utf8_decode(dec);
dec; (iKey == || iKey == (iKey > && iKey < (iKey > && iKey < (iKey > && iKey < (iKey > && iKey < (iKey > && iKey < (iKey > && iKey < !(iCase === 0 || iCase == 1)
= = = = = v1 = v1.split( v2 = v2.split(