{"id":2434,"date":"2020-03-20T09:21:01","date_gmt":"2020-03-20T01:21:01","guid":{"rendered":"http:\/\/www.yuguoxy.com\/geekhome\/?p=2434"},"modified":"2026-08-18T12:35:24","modified_gmt":"2026-08-18T04:35:24","slug":"javascript%e5%b7%a5%e5%85%b7%e5%87%bd%e6%95%b0%e5%a4%a7%e5%85%a8%e4%b8%80","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=2434","title":{"rendered":"JavaScript\u5de5\u5177\u51fd\u6570\u5927\u5168(\u4e00)"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<p style=\"margin: 1em 0px;\">\u8fd9\u662f\u4e00\u7ec4\u504f\u201c\u9875\u9762\u811a\u672c\u201d\u7684 JavaScript \u5de5\u5177\u51fd\u6570\uff1a\u4e8b\u4ef6\u3001\u7f16\u7801\u3001\u6536\u85cf\u5939\u3001\u52a8\u6001\u52a0\u8f7d\u811a\u672c\u3001\u56de\u5230\u9876\u90e8\u3001Base64\u3001\u5168\u89d2\u534a\u89d2\u3001\u7248\u672c\u53f7\u6bd4\u8f83\u548c CSS \u538b\u7f29\u683c\u5f0f\u5316\u3002\u539f\u6587\uff1a<a href=\"https:\/\/github.com\/Wscats\/CV\/issues\/27\">https:\/\/github.com\/Wscats\/CV\/issues\/27<\/a>\u3002\u4e0b\u9762<strong style=\"color: #4870ac;\">\u5168\u90e8\u51fd\u6570\u90fd\u4fdd\u7559<\/strong>\uff0c\u53ea\u4fee\u6b63\u660e\u663e\u5199\u574f\u7684\u8bed\u6cd5\uff08\u591a\u4f59\u987f\u53f7\u3001\u4e2d\u6587\u9017\u53f7\uff09\u4ee5\u53ca HtmlEncode \/ delEvt \u7684\u5b9e\u73b0\u9519\u8bef\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u90e8\u5206\u51fd\u6570\u4f9d\u8d56\u9875\u9762\u5168\u5c40\uff08\u5982 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">appendscript<\/code> \u91cc\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">hash<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">in_array<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">evalscripts<\/code>\uff09\uff0c\u79fb\u690d\u65f6\u8981\u4e00\u5e76\u5e26\u4e0a\u8fd9\u4e9b\u8f85\u52a9\u91cf\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e00\u3001\u4e8b\u4ef6\u4e0e DOM \u6269\u5c55<\/h2>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4e3a\u5143\u7d20\u6dfb\u52a0 on \u65b9\u6cd5<\/h3>\n<p style=\"margin: 1em 0px;\">\u4e3a\u5143\u7d20\u6dfb\u52a0on\u65b9\u6cd5<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">Element.prototype.on = Element.prototype.addEventListener;\n\n\n\nNodeList.prototype.on = function (event, fn) {\n\n    []['forEach'].call(this, function (el) {\n\n        el.on(event, fn);\n\n    });\n\n    return this;\n\n};<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4e3a\u5143\u7d20\u6dfb\u52a0 trigger \u65b9\u6cd5<\/h3>\n<p style=\"margin: 1em 0px;\">\u4e3a\u5143\u7d20\u6dfb\u52a0trigger\u65b9\u6cd5<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">Element.prototype.trigger = function(type, data) {\n\n  var event = document.createEvent(\"HTMLEvents\");\n\n  event.initEvent(type, true, true);\n\n  event.data = data || {};\n\n  event.eventName = type;\n\n  event.target = this;\n\n  this.dispatchEvent(event);\n\n  return this;\n\n};\n\n\n\nNodeList.prototype.trigger = function(event) {\n\n  [][\"forEach\"].call(this, function(el) {\n\n    el[\"trigger\"](event);\n\n  });\n\n  return this;\n\n};<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u8f6c\u4e49 HTML \u6807\u7b7e\uff08HtmlEncode\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">\u8f6c\u4e49html\u6807\u7b7e<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function HtmlEncode(text) {\n  return text\n    .replace(\/&amp;\/g, \"&amp;amp;\")\n    .replace(\/\"\/g, \"&amp;quot;\")\n    .replace(\/&lt;\/g, \"&amp;lt;\")\n    .replace(\/&gt;\/g, \"&amp;gt;\");\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">HTML \u6807\u7b7e\u8f6c\u4e49\uff08SaferHTML \u6a21\u677f\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">HTML\u6807\u7b7e\u8f6c\u4e49<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">\/\/ HTML \u6807\u7b7e\u8f6c\u4e49\n\n\/\/ @param {Array.&lt;DOMString&gt;} templateData \u5b57\u7b26\u4e32\u7c7b\u578b\u7684tokens\n\n\/\/ @param {...} ..vals \u8868\u8fbe\u5f0f\u5360\u4f4d\u7b26\u7684\u8fd0\u7b97\u7ed3\u679ctokens\n\n\/\/\n\nfunction SaferHTML(templateData) {\n\n  var s = templateData[0];\n\n  for (var i = 1; i &lt; arguments.length; i++) {\n\n    var arg = String(arguments[i]);\n\n    \/\/ Escape special characters in the substitution.\n\n    s += arg\n\n      .replace(\/&amp;\/g, \"&amp;\")\n\n      .replace(\/&lt;\/g, \"&lt;\")\n\n      .replace(\/&gt;\/g, \"&gt;\");\n\n    \/\/ Don't escape special characters in the template.\n\n    s += templateData[i];\n\n  }\n\n  return s;\n\n}\n\n\/\/ \u8c03\u7528\n\nvar html = SaferHTML`&lt;p&gt;\u8fd9\u662f\u5173\u4e8e\u5b57\u7b26\u4e32\u6a21\u677f\u7684\u4ecb\u7ecd&lt;\/p&gt;`;<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u8de8\u6d4f\u89c8\u5668\u7ed1\u5b9a\u4e8b\u4ef6<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function addEventSamp(obj, evt, fn) {\n\n  if (!oTarget) {\n\n    return;\n\n  }\n\n  if (obj.addEventListener) {\n\n    obj.addEventListener(evt, fn, false);\n\n  } else if (obj.attachEvent) {\n\n    obj.attachEvent(\"on\" + evt, fn);\n\n  } else {\n\n    oTarget[\"on\" + sEvtType] = fn;\n\n  }\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u52a0\u5165\u6536\u85cf\u5939<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function addFavorite(sURL, sTitle) {\n\n  try {\n\n    window.external.addFavorite(sURL, sTitle);\n\n  } catch (e) {\n\n    try {\n\n      window.sidebar.addPanel(sTitle, sURL, \"\");\n\n    } catch (e) {\n\n      alert(\"\u52a0\u5165\u6536\u85cf\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528Ctrl+D\u8fdb\u884c\u6dfb\u52a0\");\n\n    }\n\n  }\n\n}<\/code><\/pre>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e8c\u3001\u9875\u9762\u8d44\u6e90\u4e0e\u811a\u672c<\/h2>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u63d0\u53d6\u9875\u9762\u4ee3\u7801\u4e2d\u6240\u6709\u7f51\u5740<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">var aa = document.documentElement.outerHTML\n\n  .match(\n\n    \/(url\\(|src=|href=)[\\\"\\']*([^\\\"\\'\\(\\)\\&lt;\\&gt;\\[\\] ]+)[\\\"\\'\\)]*|(http:\\\/\\\/[\\w\\-\\.]+[^\\\"\\'\\(\\)\\&lt;\\&gt;\\[\\] ]+)\/gi\n\n  )\n\n  .join(\"\\r\\n\")\n\n  .replace(\/^(src=|href=|url\\()[\\\"\\']*|[\\\"\\'\\&gt;\\) ]*$\/gim, \"\");\n\nalert(aa);<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u52a8\u6001\u52a0\u8f7d\u811a\u672c\u6587\u4ef6<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function appendscript(src, text, reload, charset) {\n\n  var id = hash(src + text);\n\n  if (!reload &amp;&amp; in_array(id, evalscripts)) return;\n\n  if (reload &amp;&amp; $(id)) {\n\n    $(id).parentNode.removeChild($(id));\n\n  }\n\n\n\n  evalscripts.push(id);\n\n  var scriptNode = document.createElement(\"script\");\n\n  scriptNode.type = \"text\/javascript\";\n\n  scriptNode.id = id;\n\n  scriptNode.charset = charset\n\n    ? charset\n\n    : BROWSER.firefox\n\n    ? document.characterSet\n\n    : document.charset;\n\n  try {\n\n    if (src) {\n\n      scriptNode.src = src;\n\n      scriptNode.onloadDone = false;\n\n      scriptNode.onload = function() {\n\n        scriptNode.onloadDone = true;\n\n        JSLOADED[src] = 1;\n\n      };\n\n      scriptNode.onreadystatechange = function() {\n\n        if (\n\n          (scriptNode.readyState == \"loaded\" ||\n\n            scriptNode.readyState == \"complete\") &amp;&amp;\n\n          !scriptNode.onloadDone\n\n        ) {\n\n          scriptNode.onloadDone = true;\n\n          JSLOADED[src] = 1;\n\n        }\n\n      };\n\n    } else if (text) {\n\n      scriptNode.text = text;\n\n    }\n\n    document.getElementsByTagName(\"head\")[0].appendChild(scriptNode);\n\n  } catch (e) {}\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u8fd4\u56de\u9876\u90e8\u7684\u901a\u7528\u65b9\u6cd5<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function backTop(btnId) {\n\n  var btn = document.getElementById(btnId);\n\n  var d = document.documentElement;\n\n  var b = document.body;\n\n  window.onscroll = set;\n\n  btn.style.display = \"none\";\n\n  btn.onclick = function() {\n\n    btn.style.display = \"none\";\n\n    window.onscroll = null;\n\n    this.timer = setInterval(function() {\n\n      d.scrollTop -= Math.ceil((d.scrollTop + b.scrollTop) * 0.1);\n\n      b.scrollTop -= Math.ceil((d.scrollTop + b.scrollTop) * 0.1);\n\n      if (d.scrollTop + b.scrollTop == 0)\n\n        clearInterval(btn.timer, (window.onscroll = set));\n\n    }, 10);\n\n  };\n\n  function set() {\n\n    btn.style.display = d.scrollTop + b.scrollTop &gt; 100 ? \"block\" : \"none\";\n\n  }\n\n}\n\nbackTop(\"goTop\");<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u5b9e\u73b0 base64 \u89e3\u7801<\/h3>\n<p style=\"margin: 1em 0px;\">\u5b9e\u73b0base64\u89e3\u7801<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function base64_decode(data) {\n\n  var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=\";\n\n  var o1,\n\n    o2,\n\n    o3,\n\n    h1,\n\n    h2,\n\n    h3,\n\n    h4,\n\n    bits,\n\n    i = 0,\n\n    ac = 0,\n\n    dec = \"\",\n\n    tmp_arr = [];\n\n  if (!data) {\n\n    return data;\n\n  }\n\n  data += \"\";\n\n  do {\n\n    h1 = b64.indexOf(data.charAt(i++));\n\n    h2 = b64.indexOf(data.charAt(i++));\n\n    h3 = b64.indexOf(data.charAt(i++));\n\n    h4 = b64.indexOf(data.charAt(i++));\n\n    bits = (h1 &lt;&lt; 18) | (h2 &lt;&lt; 12) | (h3 &lt;&lt; 6) | h4;\n\n    o1 = (bits &gt;&gt; 16) &amp; 0xff;\n\n    o2 = (bits &gt;&gt; 8) &amp; 0xff;\n\n    o3 = bits &amp; 0xff;\n\n    if (h3 == 64) {\n\n      tmp_arr[ac++] = String.fromCharCode(o1);\n\n    } else if (h4 == 64) {\n\n      tmp_arr[ac++] = String.fromCharCode(o1, o2);\n\n    } else {\n\n      tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n\n    }\n\n  } while (i &lt; data.length);\n\n  dec = tmp_arr.join(\"\");\n\n  dec = utf8_decode(dec);\n\n  return dec;\n\n}<\/code><\/pre>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e09\u3001\u8f93\u5165\u3001\u7f16\u7801\u4e0e\u5b57\u7b26\u4e32<\/h2>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u786e\u8ba4\u662f\u5426\u662f\u952e\u76d8\u6709\u6548\u8f93\u5165\u503c<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function checkKey(iKey) {\n\n  if (iKey == 32 || iKey == 229) {\n\n    return true;\n\n  } \/*\u7a7a\u683c\u548c\u5f02\u5e38*\/\n\n  if (iKey &gt; 47 &amp;&amp; iKey &lt; 58) {\n\n    return true;\n\n  } \/*\u6570\u5b57*\/\n\n  if (iKey &gt; 64 &amp;&amp; iKey &lt; 91) {\n\n    return true;\n\n  } \/*\u5b57\u6bcd*\/\n\n  if (iKey &gt; 95 &amp;&amp; iKey &lt; 108) {\n\n    return true;\n\n  } \/*\u6570\u5b57\u952e\u76d81*\/\n\n  if (iKey &gt; 108 &amp;&amp; iKey &lt; 112) {\n\n    return true;\n\n  } \/*\u6570\u5b57\u952e\u76d82*\/\n\n  if (iKey &gt; 185 &amp;&amp; iKey &lt; 193) {\n\n    return true;\n\n  } \/*\u7b26\u53f71*\/\n\n  if (iKey &gt; 218 &amp;&amp; iKey &lt; 223) {\n\n    return true;\n\n  } \/*\u7b26\u53f72*\/\n\n  return false;\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u5168\u89d2\u534a\u89d2\u8f6c\u6362<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">\/\/iCase: 0\u5168\u5230\u534a\uff0c1\u534a\u5230\u5168\uff0c\u5176\u4ed6\u4e0d\u8f6c\u5316\n\nfunction chgCase(sStr, iCase) {\n\n  if (\n\n    typeof sStr != \"string\" ||\n\n    sStr.length &lt;= 0 ||\n\n    !(iCase === 0 || iCase == 1)\n\n  ) {\n\n    return sStr;\n\n  }\n\n  var i,\n\n    oRs = [],\n\n    iCode;\n\n  if (iCase) {\n\n    \/*\u534a-&gt;\u5168*\/\n\n    for (i = 0; i &lt; sStr.length; i += 1) {\n\n      iCode = sStr.charCodeAt(i);\n\n      if (iCode == 32) {\n\n        iCode = 12288;\n\n      } else if (iCode &lt; 127) {\n\n        iCode += 65248;\n\n      }\n\n      oRs.push(String.fromCharCode(iCode));\n\n    }\n\n  } else {\n\n    \/*\u5168-&gt;\u534a*\/\n\n    for (i = 0; i &lt; sStr.length; i += 1) {\n\n      iCode = sStr.charCodeAt(i);\n\n      if (iCode == 12288) {\n\n        iCode = 32;\n\n      } else if (iCode &gt; 65280 &amp;&amp; iCode &lt; 65375) {\n\n        iCode -= 65248;\n\n      }\n\n      oRs.push(String.fromCharCode(iCode));\n\n    }\n\n  }\n\n  return oRs.join(\"\");\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u7248\u672c\u5bf9\u6bd4<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function compareVersion(v1, v2) {\n\n  v1 = v1.split(\".\");\n\n  v2 = v2.split(\".\");\n\n\n\n  var len = Math.max(v1.length, v2.length);\n\n\n\n  while (v1.length &lt; len) {\n\n    v1.push(\"0\");\n\n  }\n\n\n\n  while (v2.length &lt; len) {\n\n    v2.push(\"0\");\n\n  }\n\n\n\n  for (var i = 0; i &lt; len; i++) {\n\n    var num1 = parseInt(v1[i]);\n\n    var num2 = parseInt(v2[i]);\n\n\n\n    if (num1 &gt; num2) {\n\n      return 1;\n\n    } else if (num1 &lt; num2) {\n\n      return -1;\n\n    }\n\n  }\n\n  return 0;\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u538b\u7f29 CSS \u6837\u5f0f\u4ee3\u7801<\/h3>\n<p style=\"margin: 1em 0px;\">\u538b\u7f29CSS\u6837\u5f0f\u4ee3\u7801<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function compressCss(s) {\n\n  \/\/\u538b\u7f29\u4ee3\u7801\n\n  s = s.replace(\/\\\/\\*(.|\\n)*?\\*\\\/\/g, \"\"); \/\/\u5220\u9664\u6ce8\u91ca\n\n  s = s.replace(\/\\s*([\\{\\}\\:\\;\\,])\\s*\/g, \"$1\");\n\n  s = s.replace(\/\\,[\\s\\.\\#\\d]*\\{\/g, \"{\"); \/\/\u5bb9\u9519\u5904\u7406\n\n  s = s.replace(\/;\\s*;\/g, \";\"); \/\/\u6e05\u9664\u8fde\u7eed\u5206\u53f7\n\n  s = s.match(\/^\\s*(\\S+(\\s+\\S+)*)\\s*$\/); \/\/\u53bb\u6389\u9996\u5c3e\u7a7a\u767d\n\n  return s == null ? \"\" : s[1];\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u83b7\u53d6\u5f53\u524d\u8def\u5f84<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">var currentPageUrl = \"\";\n\nif (typeof this.href === \"undefined\") {\n\n  currentPageUrl = document.location.toString().toLowerCase();\n\n} else {\n\n  currentPageUrl = this.href.toString().toLowerCase();\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u5b57\u7b26\u4e32\u957f\u5ea6\u622a\u53d6<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function cutstr(str, len) {\n\n    var temp,\n\n        icount = 0,\n\n        patrn = \/[^\\x00-\\xff]\/,\n\n        strre = \"\";\n\n    for (var i = 0; i &lt; str.length; i++) {\n\n        if (icount &lt; len - 1) {\n\n            temp = str.substr(i, 1);\n\n                if (patrn.exec(temp) == null) {\n\n                   icount = icount + 1\n\n            } else {\n\n                icount = icount + 2\n\n            }\n\n            strre += temp\n\n            } else {\n\n            break;\n\n        }\n\n    }\n\n    return strre + \"...\"\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u65f6\u95f4\u65e5\u671f\u683c\u5f0f\u8f6c\u6362<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">Date.prototype.format = function(formatStr) {\n\n  var str = formatStr;\n\n  var Week = [\"\u65e5\", \"\u4e00\", \"\u4e8c\", \"\u4e09\", \"\u56db\", \"\u4e94\", \"\u516d\"];\n\n  str = str.replace(\/yyyy|YYYY\/, this.getFullYear());\n\n  str = str.replace(\n\n    \/yy|YY\/,\n\n    this.getYear() % 100 &gt; 9\n\n      ? (this.getYear() % 100).toString()\n\n      : \"0\" + (this.getYear() % 100)\n\n  );\n\n  str = str.replace(\n\n    \/MM\/,\n\n    this.getMonth() + 1 &gt; 9\n\n      ? (this.getMonth() + 1).toString()\n\n      : \"0\" + (this.getMonth() + 1)\n\n  );\n\n  str = str.replace(\/M\/g, this.getMonth() + 1);\n\n  str = str.replace(\/w|W\/g, Week[this.getDay()]);\n\n  str = str.replace(\n\n    \/dd|DD\/,\n\n    this.getDate() &gt; 9 ? this.getDate().toString() : \"0\" + this.getDate()\n\n  );\n\n  str = str.replace(\/d|D\/g, this.getDate());\n\n  str = str.replace(\n\n    \/hh|HH\/,\n\n    this.getHours() &gt; 9 ? this.getHours().toString() : \"0\" + this.getHours()\n\n  );\n\n  str = str.replace(\/h|H\/g, this.getHours());\n\n  str = str.replace(\n\n    \/mm\/,\n\n    this.getMinutes() &gt; 9\n\n      ? this.getMinutes().toString()\n\n      : \"0\" + this.getMinutes()\n\n  );\n\n  str = str.replace(\/m\/g, this.getMinutes());\n\n  str = str.replace(\n\n    \/ss|SS\/,\n\n    this.getSeconds() &gt; 9\n\n      ? this.getSeconds().toString()\n\n      : \"0\" + this.getSeconds()\n\n  );\n\n  str = str.replace(\/s|S\/g, this.getSeconds());\n\n  return str;\n\n};\n\n\n\n\/\/ \u6216\n\nDate.prototype.format = function(format) {\n\n  var o = {\n\n    \"M+\": this.getMonth() + 1, \/\/month\n\n    \"d+\": this.getDate(), \/\/day\n\n    \"h+\": this.getHours(), \/\/hour\n\n    \"m+\": this.getMinutes(), \/\/minute\n\n    \"s+\": this.getSeconds(), \/\/second\n\n    \"q+\": Math.floor((this.getMonth() + 3) \/ 3), \/\/quarter\n\n    S: this.getMilliseconds() \/\/millisecond\n\n  };\n\n  if (\/(y+)\/.test(format))\n\n    format = format.replace(\n\n      RegExp.$1,\n\n      (this.getFullYear() + \"\").substr(4 - RegExp.$1.length)\n\n    );\n\n  for (var k in o) {\n\n    if (new RegExp(\"(\" + k + \")\").test(format))\n\n      format = format.replace(\n\n        RegExp.$1,\n\n        RegExp.$1.length == 1 ? o[k] : (\"00\" + o[k]).substr((\"\" + o[k]).length)\n\n      );\n\n  }\n\n  return format;\n\n};\n\nalert(new Date().format(\"yyyy-MM-dd hh:mm:ss\"));<\/code><\/pre>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u56db\u3001\u4e8b\u4ef6\u5378\u8f7d\u3001\u540e\u7f00\u4e0e CSS \u683c\u5f0f\u5316<\/h2>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u8de8\u6d4f\u89c8\u5668\u5220\u9664\u4e8b\u4ef6<\/h3>\n<p style=\"margin: 1em 0px;\">\u8de8\u6d4f\u89c8\u5668\u5220\u9664\u4e8b\u4ef6\uff08\u539f\u6587\u8bef\u5199\u6210 addEventListener \/ attachEvent\uff0c\u8fd9\u91cc\u6309\u201c\u5220\u9664\u4e8b\u4ef6\u201d\u6539\u6b63\uff09<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function delEvt(obj, evt, fn) {\n  if (!obj) {\n    return;\n  }\n  if (obj.removeEventListener) {\n    obj.removeEventListener(evt, fn, false);\n  } else if (obj.detachEvent) {\n    obj.detachEvent(\"on\" + evt, fn);\n  } else {\n    obj[\"on\" + evt] = null;\n  }\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u5224\u65ad\u662f\u5426\u4ee5\u67d0\u4e2a\u5b57\u7b26\u4e32\u7ed3\u675f<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">String.prototype.endWith = function(s) {\n\n  var d = this.length - s.length;\n\n  return d &gt;= 0 &amp;&amp; this.lastIndexOf(s) == d;\n\n};<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u8fd4\u56de\u811a\u672c\u5185\u5bb9<\/h3>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function evalscript(s) {\n\n  if (s.indexOf(\"&lt;script\") == -1) return s;\n\n  var p = \/&lt;script[^\\&gt;]*?&gt;([^\\x00]*?)&lt;\\\/script&gt;\/gi;\n\n  var arr = [];\n\n  while ((arr = p.exec(s))) {\n\n    var p1 = \/&lt;script[^\\&gt;]*?src=\\\"([^\\&gt;]*?)\\\"[^\\&gt;]*?(reload=\\\"1\\\")?(?:charset=\\\"([\\w\\-]+?)\\\")?&gt;&lt;\\\/script&gt;\/i;\n\n    var arr1 = [];\n\n    arr1 = p1.exec(arr[0]);\n\n    if (arr1) {\n\n      appendscript(arr1[1], \"\", arr1[2], arr1[3]);\n\n    } else {\n\n      p1 = \/&lt;script(.*?)&gt;([^\\x00]+?)&lt;\\\/script&gt;\/i;\n\n      arr1 = p1.exec(arr[0]);\n\n      appendscript(\"\", arr1[2], arr1[1].indexOf(\"reload=\") != -1);\n\n    }\n\n  }\n\n  return s;\n\n}<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u683c\u5f0f\u5316 CSS \u6837\u5f0f\u4ee3\u7801<\/h3>\n<p style=\"margin: 1em 0px;\">\u683c\u5f0f\u5316CSS\u6837\u5f0f\u4ee3\u7801<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">function formatCss(s) {\n\n  \/\/\u683c\u5f0f\u5316\u4ee3\u7801\n\n  s = s.replace(\/\\s*([\\{\\}\\:\\;\\,])\\s*\/g, \"$1\");\n\n  s = s.replace(\/;\\s*;\/g, \";\"); \/\/\u6e05\u9664\u8fde\u7eed\u5206\u53f7\n\n  s = s.replace(\/\\,[\\s\\.\\#\\d]*{\/g, \"{\");\n\n  s = s.replace(\/([^\\s])\\{([^\\s])\/g, \"$1 {\\n\\t$2\");\n\n  s = s.replace(\/([^\\s])\\}([^\\n]*)\/g, \"$1\\n}\\n$2\");\n\n  s = s.replace(\/([^\\s]);([^\\s\\}])\/g, \"$1;\\n\\t$2\");\n\n  return s;\n\n}<\/code><\/pre>\n<table style=\"display: table; text-align: left; overflow: auto; border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; overflow-wrap: break-word; word-break: break-all;\" width=\"800\">\n<thead>\n<tr>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u51fd\u6570<\/th>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u7528\u9014<\/th>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u6ce8\u610f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">on<\/code> \/ <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">trigger<\/code><\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u6279\u91cf\u7ed1\u5b9a\u4e0e\u6d3e\u53d1<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u57fa\u4e8e addEventListener \/ HTMLEvents<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">SaferHTML<\/code><\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u6a21\u677f\u5b57\u7b26\u4e32\u9632 XSS<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u53ea\u8f6c\u4e49\u63d2\u503c\uff0c\u4e0d\u8f6c\u4e49\u6a21\u677f\u672c\u8eab<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">backTop<\/code><\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u5e73\u6ed1\u56de\u5230\u9876\u90e8<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u4f1a\u6539\u5199 window.onscroll<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">compareVersion<\/code><\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u70b9\u5206\u7248\u672c\u6bd4\u8f83<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7f3a\u4f4d\u8865 0<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">endWith<\/code><\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u662f\u5426\u4ee5\u67d0\u540e\u7f00\u7ed3\u675f<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u53ef\u7528 ES6 endsWith \u66ff\u4ee3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">addEventSamp<\/code> \u539f\u6587\u5224\u65ad\u7684\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">oTarget<\/code>\uff0c\u53c2\u6570\u5374\u53eb <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">obj<\/code>\uff0c\u8c03\u7528\u65f6\u52a1\u5fc5\u4f20\u5165\u771f\u5b9e\u8282\u70b9\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">delEvt<\/code> \u539f\u6587\u628a\u5220\u9664\u5199\u6210\u4e86\u518d\u6b21\u7ed1\u5b9a\uff0c\u5df2\u6309 removeEventListener \/ detachEvent \u6539\u6b63\u3002<\/p>\n<blockquote style=\"display: block; font-size: 0.9em; border-left: 3px solid #4870ac; padding: 0.5em 1em; margin: 0px; background: #f6f8fa; color: #40464f;\">\n<p style=\"margin: 1em 0px;\"><strong style=\"color: #4870ac;\">\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u8fd9\u4e9b\u5de5\u5177\u51fd\u6570\u8986\u76d6\u4e8b\u4ef6\u3001\u7f16\u7801\u3001\u811a\u672c\u52a0\u8f7d\u548c\u5b57\u7b26\u4e32\u65e5\u671f\u5904\u7406\uff1b\u80fd\u7528\u539f\u751f API \u7684\u5730\u65b9\u4f18\u5148\u539f\u751f\uff0c\u62f7\u8d1d\u65f6\u6ce8\u610f\u539f\u6587\u91cc\u7684\u5168\u5c40\u4f9d\u8d56\u548c\u7b14\u8bef\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u7ec4\u504f\u201c\u9875\u9762\u811a\u672c\u201d\u7684 JavaScript \u5de5\u5177\u51fd\u6570\uff1a\u4e8b\u4ef6\u3001\u7f16\u7801\u3001\u6536\u85cf\u5939\u3001\u52a8\u6001\u52a0\u8f7d\u811a\u672c\u3001\u56de\u5230\u9876\u90e8\u3001Base [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[109,105],"tags":[150],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2434"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2434"}],"version-history":[{"count":2,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2434\/revisions"}],"predecessor-version":[{"id":2439,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2434\/revisions\/2439"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}