{"id":3002,"date":"2020-08-08T09:47:33","date_gmt":"2020-08-08T01:47:33","guid":{"rendered":"http:\/\/www.yuguoxy.com\/geekhome\/?p=3002"},"modified":"2026-08-18T12:35:32","modified_gmt":"2026-08-18T04:35:32","slug":"javascript%e9%9d%a2%e8%af%95%e9%a2%98-%e8%af%a6%e7%bb%86%e7%89%88","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3002","title":{"rendered":"javascript\u9762\u8bd5\u9898-\u8be6\u7ec6\u7248"},"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\u4efd <strong style=\"color: #4870ac;\">JavaScript \u9762\u8bd5\u9898<\/strong> \u8be6\u7ec6\u7248\uff0c\u4ece typeof\u3001\u7c7b\u578b\u8f6c\u6362\u3001\u6570\u7ec4\u65b9\u6cd5\u8bb2\u5230\u95ed\u5305\u3001\u539f\u578b\u3001\u5f02\u6b65\u548c DOM\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u6bcf\u9898\u4fdd\u7559\u539f\u95ee\u7b54\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u6309\u9898\u53f7\u987a\u5e8f\u9605\u8bfb\u5373\u53ef\u3002<\/p>\n<p><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/05\/\u256c\u0432\u2568\u253c\u255c\u256a\u2550\u255d_20200509100925.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2944\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/05\/\u256c\u0432\u2568\u253c\u255c\u256a\u2550\u255d_20200509100925.png\" alt=\"\u256c\u0432\u2568\u253c\u255c\u256a\u2550\u255d_20200509100925\" width=\"678\" height=\"367\" \/><\/a><\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">1. javascript\u7684typeof\u8fd4\u56de\u54ea\u4e9b\u6570\u636e\u7c7b\u578b.<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1astring,boolean,number,undefined,function,object<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">2. \u4f8b\u4e3e3\u79cd\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u548c2\u79cd\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362?<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u5f3a\u5236\uff08parseInt,parseFloat,number\uff09 \u9690\u5f0f\uff08== ===\uff09<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">3. split() join() \u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u524d\u8005\u662f\u5c06\u5b57\u7b26\u4e32\u5207\u5272\u6210\u6570\u7ec4\u7684\u5f62\u5f0f\uff0c\u540e\u8005\u662f\u5c06\u6570\u7ec4\u8f6c\u6362\u6210\u5b57\u7b26\u4e32<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">4. \u6570\u7ec4\u65b9\u6cd5pop() push() unshift() shift()<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1apush()\u5c3e\u90e8\u6dfb\u52a0 pop()\u5c3e\u90e8\u5220\u9664 unshift()\u5934\u90e8\u6dfb\u52a0 shift()\u5934\u90e8\u5220\u9664<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">5. IE\u548c\u6807\u51c6\u4e0b\u6709\u54ea\u4e9b\u517c\u5bb9\u6027\u7684\u5199\u6cd5<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a<\/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;\">var ev = ev || window.event\ndocument.documentElement.clientWidth || document.body.clientWidth\nVar target = ev.srcElement||ev.target\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">6. ajax\u8bf7\u6c42\u7684\u65f6\u5019get \u548cpost\u65b9\u5f0f\u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a \u4e00\u4e2a\u5728url\u540e\u9762 \uff0c\u4e00\u4e2a\u653e\u5728\u865a\u62df\u8f7d\u4f53\u91cc\u9762 get\u6709\u5927\u5c0f\u9650\u5236(\u53ea\u80fd\u63d0\u4ea4\u5c11\u91cf\u53c2\u6570) \u5b89\u5168\u95ee\u9898 \u5e94\u7528\u4e0d\u540c \uff0c\u8bf7\u6c42\u6570\u636e\u548c\u63d0\u4ea4\u6570\u636e<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">7. call\u548capply\u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a Object.call(this,obj1,obj2,obj3) Object.apply(this,arguments)<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">8. ajax\u8bf7\u6c42\u65f6\uff0c\u5982\u4f55\u89e3\u6790json\u6570\u636e<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u4f7f\u7528JSON.parse<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">9. \u4e8b\u4ef6\u59d4\u6258\u662f\u4ec0\u4e48<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848: \u5229\u7528\u4e8b\u4ef6\u5192\u6ce1\u7684\u539f\u7406\uff0c\u8ba9\u81ea\u5df1\u7684\u6240\u89e6\u53d1\u7684\u4e8b\u4ef6\uff0c\u8ba9\u4ed6\u7684\u7236\u5143\u7d20\u4ee3\u66ff\u6267\u884c\uff01<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">10. \u95ed\u5305\u662f\u4ec0\u4e48\uff0c\u6709\u4ec0\u4e48\u7279\u6027\uff0c\u5bf9\u9875\u9762\u6709\u4ec0\u4e48\u5f71\u54cd<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u95ed\u5305\u5c31\u662f\u80fd\u591f\u8bfb\u53d6\u5176\u4ed6\u51fd\u6570\u5185\u90e8\u53d8\u91cf\u7684\u51fd\u6570,\u4f7f\u5f97\u51fd\u6570\u4e0d\u88abGC\u56de\u6536\uff0c\u5982\u679c\u8fc7\u591a\u4f7f\u7528\u95ed\u5305\uff0c\u5bb9\u6613\u5bfc\u81f4\u5185\u5b58\u6cc4\u9732<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">11. \u5982\u4f55\u963b\u6b62\u4e8b\u4ef6\u5192\u6ce1<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1aie:\u963b\u6b62\u5192\u6ce1ev.cancelBubble = true;\u975eIE ev.stopPropagation();<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">12. \u5982\u4f55\u963b\u6b62\u9ed8\u8ba4\u4e8b\u4ef6<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a(1)return false\uff1b(2) ev.preventDefault();<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">13. \u6dfb\u52a0 \u5220\u9664 \u66ff\u6362 \u63d2\u5165\u5230\u67d0\u4e2a\u63a5\u70b9\u7684\u65b9\u6cd5<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a<\/p>\n<p style=\"margin: 1em 0px;\">1\uff09\u521b\u5efa\u65b0\u8282\u70b9 createElement() \/\/\u521b\u5efa\u4e00\u4e2a\u5177\u4f53\u7684\u5143\u7d20 createTextNode() \/\/\u521b\u5efa\u4e00\u4e2a\u6587\u672c\u8282\u70b9<\/p>\n<p style=\"margin: 1em 0px;\">2\uff09\u6dfb\u52a0\u3001\u79fb\u9664\u3001\u66ff\u6362\u3001\u63d2\u5165 appendChild() \/\/\u6dfb\u52a0 removeChild() \/\/\u79fb\u9664 replaceChild() \/\/\u66ff\u6362 insertBefore() \/\/\u63d2\u5165<\/p>\n<p style=\"margin: 1em 0px;\">3\uff09\u67e5\u627e getElementsByTagName() \/\/\u901a\u8fc7\u6807\u7b7e\u540d\u79f0 getElementsByName() \/\/\u901a\u8fc7\u5143\u7d20\u7684Name\u5c5e\u6027\u7684\u503c getElementById() \/\/\u901a\u8fc7\u5143\u7d20Id\uff0c\u552f\u4e00\u6027<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">14. \u89e3\u91cajsonp\u7684\u539f\u7406\uff0c\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u4e0d\u662f\u771f\u6b63\u7684ajax<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u52a8\u6001\u521b\u5efascript\u6807\u7b7e\uff0c\u56de\u8c03\u51fd\u6570 Ajax\u662f\u9875\u9762\u65e0\u5237\u65b0\u8bf7\u6c42\u6570\u636e\u64cd\u4f5c<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">15. document load \u548cdocument ready\u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1adocument.onload \u662f\u5728\u7ed3\u6784\u548c\u6837\u5f0f,\u5916\u90e8js\u4ee5\u53ca\u56fe\u7247\u52a0\u8f7d\u5b8c\u624d\u6267\u884cjs document.ready\u662fdom\u6811\u521b\u5efa\u5b8c\u6210\u5c31\u6267\u884c\u7684\u65b9\u6cd5\uff0c\u539f\u751f\u79cd\u6ca1\u6709\u8fd9\u4e2a\u65b9\u6cd5\uff0cjquery\u4e2d\u6709 $().ready(function)<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">16. \u201d==\u201d\u548c\u201c===\u201d\u7684\u4e0d\u540c<\/h3>\n<p style=\"margin: 1em 0px;\">\u7b54\u6848\uff1a\u524d\u8005\u4f1a\u81ea\u52a8\u8f6c\u6362\u7c7b\u578b,\u518d\u5224\u65ad\u662f\u5426\u76f8\u7b49 \u540e\u8005\u4e0d\u4f1a\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362\uff0c\u76f4\u63a5\u53bb\u6bd4\u8f83<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">17. \u51fd\u6570\u58f0\u660e\u4e0e\u51fd\u6570\u8868\u8fbe\u5f0f\u7684\u533a\u522b\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u5728Javscript\u4e2d\uff0c\u89e3\u6790\u5668\u5728\u5411\u6267\u884c\u73af\u5883\u4e2d\u52a0\u8f7d\u6570\u636e\u65f6\uff0c\u5bf9\u51fd\u6570\u58f0\u660e\u548c\u51fd\u6570\u8868\u8fbe\u5f0f\u5e76\u975e\u662f\u4e00\u89c6\u540c\u4ec1\u7684\uff0c\u89e3\u6790\u5668\u4f1a\u7387\u5148\u8bfb\u53d6\u51fd\u6570\u58f0\u660e\uff0c\u5e76\u4f7f\u5176\u5728\u6267\u884c\u4efb\u4f55\u4ee3\u7801\u4e4b\u524d\u53ef\u7528\uff08\u53ef\u4ee5\u8bbf\u95ee\uff09\uff0c\u81f3\u4e8e\u51fd\u6570\u8868\u8fbe\u5f0f\uff0c\u5219\u5fc5\u987b\u7b49\u5230\u89e3\u6790\u5668\u6267\u884c\u5230\u5b83\u6240\u5728\u7684\u4ee3\u7801\u884c\uff0c\u624d\u4f1a\u771f\u6b63\u88ab\u89e3\u6790\u6267\u884c\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">18. \u5bf9\u4f5c\u7528\u57df\u4e0a\u4e0b\u6587\u548cthis\u7684\u7406\u89e3\uff0c\u770b\u4e0b\u5217\u4ee3\u7801\uff1a<\/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 User = {\n count: 1,\n getCount: function() {\n  return this.count;\n }\n};\nconsole.log(User.getCount()); \/\/ what?\nvar func = User.getCount;\nconsole.log(func()); \/\/ what?\n\u95ee\u4e24\u5904console\u8f93\u51fa\u4ec0\u4e48\uff1f\u4e3a\u4ec0\u4e48\uff1f\n\u7b54\u6848:\u662f1\u548cundefined\u3002\n\u3000\u3000func\u662f\u5728window\u7684\u4e0a\u4e0b\u6587\u4e2d\u88ab\u6267\u884c\u7684\uff0c\u6240\u4ee5\u4e0d\u4f1a\u8bbf\u95ee\u5230count\u5c5e\u6027\u3002\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">19. \u770b\u4e0b\u9762\u4ee3\u7801\uff0c\u7ed9\u51fa\u8f93\u51fa\u7ed3\u679c\u3002<\/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;\">for(var i = 1; i &lt;= 3; i++){  \/\/\u5efa\u8bae\u4f7f\u7528let \u53ef\u6b63\u5e38\u8f93\u51fai\u7684\u503c\n  setTimeout(function(){\n      console.log(i);   \n  },0); \n};\n\u7b54\u6848\uff1a4 4 4\u3002\n\u539f\u56e0\uff1aJavascript\u4e8b\u4ef6\u5904\u7406\u5668\u5728\u7ebf\u7a0b\u7a7a\u95f2\u4e4b\u524d\u4e0d\u4f1a\u8fd0\u884c\u3002\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">20. \u5f53\u4e00\u4e2aDOM\u8282\u70b9\u88ab\u70b9\u51fb\u65f6\u5019\uff0c\u6211\u4eec\u5e0c\u671b\u80fd\u591f\u6267\u884c\u4e00\u4e2a\u51fd\u6570\uff0c\u5e94\u8be5\u600e\u4e48\u505a?<\/h3>\n<p style=\"margin: 1em 0px;\">box.onlick= function(){} box.addEventListener(&#8220;click&#8221;,function(){},false); <button><\/button><\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">21. Javascript\u7684\u4e8b\u4ef6\u6d41\u6a21\u578b\u90fd\u6709\u4ec0\u4e48?<\/h3>\n<p style=\"margin: 1em 0px;\">\u201c\u4e8b\u4ef6\u5192\u6ce1\u201d\uff1a\u4e8b\u4ef6\u5f00\u59cb\u7531\u6700\u5177\u4f53\u7684\u5143\u7d20\u63a5\u53d7\uff0c\u7136\u540e\u9010\u7ea7\u5411\u4e0a\u4f20\u64ad<\/p>\n<p style=\"margin: 1em 0px;\">\u201c\u4e8b\u4ef6\u6355\u6349\u201d\uff1a\u4e8b\u4ef6\u7531\u6700\u4e0d\u5177\u4f53\u7684\u8282\u70b9\u5148\u63a5\u6536\uff0c\u7136\u540e\u9010\u7ea7\u5411\u4e0b\uff0c\u4e00\u76f4\u5230\u6700\u5177\u4f53\u7684<\/p>\n<p style=\"margin: 1em 0px;\">\u201cDOM\u4e8b\u4ef6\u6d41\u201d\uff1a\u4e09\u4e2a\u9636\u6bb5\uff1a\u4e8b\u4ef6\u6355\u6349\uff0c\u76ee\u6807\u9636\u6bb5\uff0c\u4e8b\u4ef6\u5192\u6ce1<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">22. \u770b\u4e0b\u5217\u4ee3\u7801,\u8f93\u51fa\u4ec0\u4e48?\u89e3\u91ca\u539f\u56e0\u3002<\/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 a = null;\nalert(typeof a);\n\u7b54\u6848\uff1aobject\n\u89e3\u91ca\uff1anull\u662f\u4e00\u4e2a\u53ea\u6709\u4e00\u4e2a\u503c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u8fd9\u4e2a\u503c\u5c31\u662fnull\u3002\u8868\u793a\u4e00\u4e2a\u7a7a\u6307\u9488\u5bf9\u8c61\uff0c\u6240\u4ee5\u7528typeof\u68c0\u6d4b\u4f1a\u8fd4\u56de\u201dobject\u201d\u3002\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">23. \u5224\u65ad\u5b57\u7b26\u4e32\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u9762\u53ef\u4ee5\u662f\u6570\u5b57\uff0c\u4e0b\u5212\u7ebf\uff0c\u5b57\u6bcd\uff0c\u957f\u5ea6\u4e3a6-30<\/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 reg=\/^[a-zA-Z]\\w{5,29}$\/;\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">24. \u56de\u7b54\u4ee5\u4e0b\u4ee3\u7801\uff0calert\u7684\u503c\u5206\u522b\u662f\u591a\u5c11\uff1f<\/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;\">&lt;script&gt;\n     var a = 100;  \n     function test(){  \n        alert(a);  \n     a = 10;  \/\/\u53bb\u6389\u4e86var \u5c31\u53d8\u6210\u5b9a\u4e49\u4e86\u5168\u5c40\u53d8\u91cf\u4e86\n        alert(a);  \n}  \ntest();\nalert(a);\n&lt;\/script&gt;\n\u6b63\u786e\u7b54\u6848\u662f\uff1a 100\uff0c 10\uff0c 10\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">25. javaScript\u76842\u79cd\u53d8\u91cf\u8303\u56f4\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u5168\u5c40\u53d8\u91cf\uff1a\u5f53\u524d\u9875\u9762\u5185\u6709\u6548<\/p>\n<p style=\"margin: 1em 0px;\">\u5c40\u90e8\u53d8\u91cf\uff1a\u51fd\u6570\u65b9\u6cd5\u5185\u6709\u6548<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">26. null\u548cundefined\u7684\u533a\u522b\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">null\u662f\u4e00\u4e2a\u8868\u793a&#8221;\u65e0&#8221;\u7684\u5bf9\u8c61\uff0c\u8f6c\u4e3a\u6570\u503c\u65f6\u4e3a0\uff1bundefined\u662f\u4e00\u4e2a\u8868\u793a&#8221;\u65e0&#8221;\u7684\u539f\u59cb\u503c\uff0c\u8f6c\u4e3a\u6570\u503c\u65f6\u4e3aNaN\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5f53\u58f0\u660e\u7684\u53d8\u91cf\u8fd8\u672a\u88ab\u521d\u59cb\u5316\u65f6\uff0c\u53d8\u91cf\u7684\u9ed8\u8ba4\u503c\u4e3aundefined\u3002 null\u7528\u6765\u8868\u793a\u5c1a\u672a\u5b58\u5728\u7684\u5bf9\u8c61<\/p>\n<p style=\"margin: 1em 0px;\">undefined\u8868\u793a&#8221;\u7f3a\u5c11\u503c&#8221;\uff0c\u5c31\u662f\u6b64\u5904\u5e94\u8be5\u6709\u4e00\u4e2a\u503c\uff0c\u4f46\u662f\u8fd8\u6ca1\u6709\u5b9a\u4e49\u3002\u5178\u578b\u7528\u6cd5\u662f\uff1a<\/p>\n<p style=\"margin: 1em 0px;\">\uff081\uff09\u53d8\u91cf\u88ab\u58f0\u660e\u4e86\uff0c\u4f46\u6ca1\u6709\u8d4b\u503c\u65f6\uff0c\u5c31\u7b49\u4e8eundefined\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\uff082\uff09\u8c03\u7528\u51fd\u6570\u65f6\uff0c\u5e94\u8be5\u63d0\u4f9b\u7684\u53c2\u6570\u6ca1\u6709\u63d0\u4f9b\uff0c\u8be5\u53c2\u6570\u7b49\u4e8eundefined\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\uff083\uff09\u5bf9\u8c61\u6ca1\u6709\u8d4b\u503c\u7684\u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u7684\u503c\u4e3aundefined\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\uff084\uff09\u51fd\u6570\u6ca1\u6709\u8fd4\u56de\u503c\u65f6\uff0c\u9ed8\u8ba4\u8fd4\u56deundefined\u3002<\/p>\n<p style=\"margin: 1em 0px;\">null\u8868\u793a&#8221;\u6ca1\u6709\u5bf9\u8c61&#8221;\uff0c\u5373\u8be5\u5904\u4e0d\u5e94\u8be5\u6709\u503c\u3002\u5178\u578b\u7528\u6cd5\u662f\uff1a<\/p>\n<p style=\"margin: 1em 0px;\">\uff081\uff09 \u4f5c\u4e3a\u51fd\u6570\u7684\u53c2\u6570\uff0c\u8868\u793a\u8be5\u51fd\u6570\u7684\u53c2\u6570\u4e0d\u662f\u5bf9\u8c61\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\uff082\uff09 \u4f5c\u4e3a\u5bf9\u8c61\u539f\u578b\u94fe\u7684\u7ec8\u70b9\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">27. new\u64cd\u4f5c\u7b26\u5177\u4f53\u5e72\u4e86\u4ec0\u4e48\u5462?<\/h3>\n<p style=\"margin: 1em 0px;\">1\u3001\u521b\u5efa\u4e00\u4e2a\u7a7a\u5bf9\u8c61\uff0c\u5e76\u4e14 this \u53d8\u91cf\u5f15\u7528\u8be5\u5bf9\u8c61\uff0c\u540c\u65f6\u8fd8\u7ee7\u627f\u4e86\u8be5\u51fd\u6570\u7684\u539f\u578b\u3002<\/p>\n<p style=\"margin: 1em 0px;\">2\u3001\u5c5e\u6027\u548c\u65b9\u6cd5\u88ab\u52a0\u5165\u5230 this \u5f15\u7528\u7684\u5bf9\u8c61\u4e2d\u3002<\/p>\n<p style=\"margin: 1em 0px;\">3\u3001\u65b0\u521b\u5efa\u7684\u5bf9\u8c61\u7531 this \u6240\u5f15\u7528\uff0c\u5e76\u4e14\u6700\u540e\u9690\u5f0f\u7684\u8fd4\u56de this \u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">28. js\u5ef6\u8fdf\u52a0\u8f7d\u7684\u65b9\u5f0f\u6709\u54ea\u4e9b\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">defer\u548casync\u3001\u52a8\u6001\u521b\u5efaDOM\u65b9\u5f0f\uff08\u521b\u5efascript\uff0c\u63d2\u5165\u5230DOM\u4e2d\uff0c\u52a0\u8f7d\u5b8c\u6bd5\u540ecallBack\uff09\u3001\u6309\u9700\u5f02\u6b65\u8f7d\u5165js<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">29. Flash\u3001Ajax\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\uff0c\u5728\u4f7f\u7528\u4e2d\u5982\u4f55\u53d6\u820d\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">Flash ajax\u5bf9\u6bd4<\/p>\n<p style=\"margin: 1em 0px;\">(1)Flash\u9002\u5408\u5904\u7406\u591a\u5a92\u4f53\u3001\u77e2\u91cf\u56fe\u5f62\u3001\u8bbf\u95ee\u673a\u5668\uff1b\u5bf9CSS\u3001\u5904\u7406\u6587\u672c\u4e0a\u4e0d\u8db3\uff0c\u4e0d\u5bb9\u6613\u88ab\u641c\u7d22\u3002<\/p>\n<p style=\"margin: 1em 0px;\">(2)ajax\u5bf9CSS\u3001\u6587\u672c\u652f\u6301\u5f88\u597d\uff0c\u652f\u6301\u641c\u7d22\uff1b\u591a\u5a92\u4f53\u3001\u77e2\u91cf\u56fe\u5f62\u3001\u673a\u5668\u8bbf\u95ee\u4e0d\u8db3\u3002<\/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;\">\u5171\u540c\u70b9\uff1a\u4e0e\u670d\u52a1\u5668\u7684\u65e0\u5237\u65b0\u4f20\u9012\u6d88\u606f\u3001\u7528\u6237\u79bb\u7ebf\u548c\u5728\u7ebf\u72b6\u6001\u3001\u64cd\u4f5cDOM\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">30. \u5199\u4e00\u4e2a\u83b7\u53d6\u975e\u884c\u95f4\u6837\u5f0f\u7684\u51fd\u6570<\/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 getStyle(obj,attr) {\nif(obj.currentStyle) {\nreturn obj.currentStyle[attr];\n}else{\ngetComputedStyle(obi,false)[attr] \n}\n\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">31. \u5e0c\u671b\u83b7\u53d6\u5230\u9875\u9762\u4e2d\u6240\u6709\u7684checkbox\u600e\u4e48\u505a\uff1f(\u4e0d\u4f7f\u7528\u7b2c\u4e09\u65b9\u6846\u67b6)<\/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 inputs = document.getElementsByTagName(\"input\");\/\/\u83b7\u53d6\u6240\u6709\u7684input\u6807\u7b7e\u5bf9\u8c61\nvar checkboxArray = [];\/\/\u521d\u59cb\u5316\u7a7a\u6570\u7ec4\uff0c\u7528\u6765\u5b58\u653echeckbox\u5bf9\u8c61\u3002\nfor(var i=0;i&lt;inputs.length;i++){\n  var obj = inputs[i];\n  if(obj.type=='checkbox'){\n     checkboxArray.push(obj);\n  }\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">32. \u5199\u4e00\u4e2afunction\uff0c\u6e05\u9664\u5b57\u7b26\u4e32\u524d\u540e\u7684\u7a7a\u683c\u3002\uff08\u517c\u5bb9\u6240\u6709\u6d4f\u89c8\u5668\uff09<\/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.trim= function(){\n\nreturn this.replace(\/^\\s+\/,\"\").replace(\/\\s+$\/,\"\");\n\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">33. javascript\u8bed\u8a00\u7279\u6027\u4e2d\uff0c\u6709\u5f88\u591a\u65b9\u9762\u548c\u6211\u4eec\u63a5\u89e6\u7684\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u4e0d\u592a\u4e00\u6837,\u8bf7\u4e3e\u4f8b<\/h3>\n<p style=\"margin: 1em 0px;\">javascript\u8bed\u8a00\u5b9e\u73b0\u7ee7\u627f\u673a\u5236\u7684\u6838\u5fc3\u5c31\u662f 1 (\u539f\u578b)\uff0c\u800c\u4e0d\u662fJava\u8bed\u8a00\u90a3\u6837\u7684\u7c7b\u5f0f\u7ee7\u627f\u3002Javascript\u89e3\u6790\u5f15\u64ce\u5728\u8bfb\u53d6\u4e00\u4e2aObject\u7684\u5c5e\u6027\u7684\u503c\u65f6\uff0c\u4f1a\u6cbf\u7740 2 (\u539f\u578b\u94fe)\u5411\u4e0a\u5bfb\u627e\uff0c\u5982\u679c\u6700\u7ec8\u6ca1\u6709\u627e\u5230\uff0c\u5219\u8be5\u5c5e\u6027\u503c\u4e3a 3 undefined\uff1b\u5982\u679c\u6700\u7ec8\u627e\u5230\u8be5\u5c5e\u6027\u7684\u503c\uff0c\u5219\u8fd4\u56de\u7ed3\u679c\u3002\u4e0e\u8fd9\u4e2a\u8fc7\u7a0b\u4e0d\u540c\u7684\u662f\uff0c\u5f53javascript\u89e3\u6790\u5f15\u64ce\u6267\u884c\u201c\u7ed9\u4e00\u4e2aObject\u7684\u67d0\u4e2a\u5c5e\u6027\u8d4b\u503c\u201d\u7684\u65f6\u5019\uff0c\u5982\u679c\u5f53\u524dObject\u5b58\u5728\u8be5\u5c5e\u6027\uff0c\u5219\u6539\u5199\u8be5\u5c5e\u6027\u7684\u503c\uff0c\u5982\u679c\u5f53\u524d\u7684Object\u672c\u8eab\u5e76\u4e0d\u5b58\u5728\u8be5\u5c5e\u6027\uff0c\u5219\u8d4b\u503c\u8be5\u5c5e\u6027\u7684\u503c\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">34. Cookie\u5728\u5ba2\u6237\u673a\u4e0a\u662f\u5982\u4f55\u5b58\u50a8\u7684<\/h3>\n<p style=\"margin: 1em 0px;\">Cookies\u5c31\u662f\u670d\u52a1\u5668\u6682\u5b58\u653e\u5728\u4f60\u7684\u7535\u8111\u91cc\u7684\u6587\u672c\u6587\u4ef6\uff0c\u597d\u8ba9\u670d\u52a1\u5668\u7528\u6765\u8fa8\u8ba4\u4f60\u7684\u8ba1\u7b97\u673a\u3002\u5f53\u4f60\u5728\u6d4f\u89c8\u7f51\u7ad9\u7684\u65f6\u5019\uff0cWeb\u670d\u52a1\u5668\u4f1a\u5148\u9001\u4e00\u5c0f\u5c0f\u8d44\u6599\u653e\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\uff0cCookies \u4f1a\u5e2e\u4f60\u5728\u7f51\u7ad9\u4e0a\u6240\u6253\u7684\u6587\u5b57\u6216\u662f\u4e00\u4e9b\u9009\u62e9\u90fd\u8bb0\u5f55\u4e0b\u6765\u3002\u5f53\u4e0b\u6b21\u4f60\u518d\u8bbf\u95ee\u540c\u4e00\u4e2a\u7f51\u7ad9\uff0cWeb\u670d\u52a1\u5668\u4f1a\u5148\u770b\u770b\u6709\u6ca1\u6709\u5b83\u4e0a\u6b21\u7559\u4e0b\u7684Cookies\u8d44\u6599\uff0c\u6709\u7684\u8bdd\uff0c\u5c31\u4f1a\u4f9d\u636eCookie\u91cc\u7684\u5185\u5bb9\u6765\u5224\u65ad\u4f7f\u7528\u8005\uff0c\u9001\u51fa\u7279\u5b9a\u7684\u7f51\u9875\u5185\u5bb9\u7ed9\u4f60\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">35. \u5982\u4f55\u83b7\u53d6javascript\u4e09\u4e2a\u6570\u4e2d\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">Math.max(a,b,c);\/\/\u6700\u5927\u503c<\/p>\n<p style=\"margin: 1em 0px;\">Math.min(a,b,c)\/\/\u6700\u5c0f\u503c<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">36. javascript\u662f\u9762\u5411\u5bf9\u8c61\u7684\uff0c\u600e\u4e48\u4f53\u73b0javascript\u7684\u7ee7\u627f\u5173\u7cfb\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u4f7f\u7528prototype\u539f\u578b\u6765\u5b9e\u73b0\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">37. .form\u4e2d\u7684input\u53ef\u4ee5\u8bbe\u7f6e\u4e3areadonly\u548cdisable\uff0c\u8bf7\u95ee2\u8005\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">readonly\u4e0d\u53ef\u7f16\u8f91\uff0c\u4f46\u53ef\u4ee5\u9009\u62e9\u548c\u590d\u5236\uff1b\u503c\u53ef\u4ee5\u4f20\u9012\u5230\u540e\u53f0 disabled\u4e0d\u80fd\u7f16\u8f91\uff0c\u4e0d\u80fd\u590d\u5236\uff0c\u4e0d\u80fd\u9009\u62e9\uff1b\u503c\u4e0d\u53ef\u4ee5\u4f20\u9012\u5230\u540e\u53f0<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">38. \u5217\u4e3ejavaScript\u76843\u79cd\u4e3b\u8981\u6570\u636e\u7c7b\u578b\uff0c2\u79cd\u590d\u5408\u6570\u636e\u7c7b\u578b\u548c2\u79cd\u7279\u6b8a\u6570\u636e\u7c7b\u578b\u3002<\/h3>\n<p style=\"margin: 1em 0px;\">\u4e3b\u8981\u6570\u636e\u7c7b\u578b\uff1astring, boolean, number<\/p>\n<p style=\"margin: 1em 0px;\">\u590d\u5408\u6570\u636e\u7c7b\u578b\uff1afunction, object<\/p>\n<p style=\"margin: 1em 0px;\">\u7279\u6b8a\u7c7b\u578b\uff1aundefined\uff0cnull<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">39. \u7a0b\u5e8f\u4e2d\u6355\u83b7\u5f02\u5e38\u7684\u65b9\u6cd5\uff1f<\/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;\">try{\n \n}catch(e){\n \n}finally{\n \n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">40. Ajax\u539f\u7406<\/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;\">(1)\u521b\u5efa\u5bf9\u8c61\n\nvar xhr = new XMLHttpRequest();\n\n(2)\u6253\u5f00\u8bf7\u6c42\n\nxhr.open('GET', 'example.txt', true);\n\n(3)\u53d1\u9001\u8bf7\u6c42\n\nxhr.send(); \u53d1\u9001\u8bf7\u6c42\u5230\u670d\u52a1\u5668\n\n(4)\u63a5\u6536\u54cd\u5e94\n\nxhr.onreadystatechange =function(){}\n\n(1)\u5f53readystate\u503c\u4ece\u4e00\u4e2a\u503c\u53d8\u4e3a\u53e6\u4e00\u4e2a\u503c\u65f6\uff0c\u90fd\u4f1a\u89e6\u53d1readystatechange\u4e8b\u4ef6\u3002\n\n(2)\u5f53readystate==4\u65f6\uff0c\u8868\u793a\u5df2\u7ecf\u63a5\u6536\u5230\u5168\u90e8\u54cd\u5e94\u6570\u636e\u3002\n\n(3)\u5f53status ==200\u65f6\uff0c\u8868\u793a\u670d\u52a1\u5668\u6210\u529f\u8fd4\u56de\u9875\u9762\u548c\u6570\u636e\u3002\n\n(4)\u5982\u679c(2)\u548c(3)\u5185\u5bb9\u540c\u65f6\u6ee1\u8db3\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7xhr.responseText\uff0c\u83b7\u5f97\u670d\u52a1\u5668\u8fd4\u56de\u7684\u5185\u5bb9\u3002\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">41. \u89e3\u91ca\u4ec0\u4e48\u662fJson:<\/h3>\n<p style=\"margin: 1em 0px;\">(1)JSON \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f\u3002<\/p>\n<p style=\"margin: 1em 0px;\">(2)JSON \u72ec\u7acb\u4e8e\u8bed\u8a00\u548c\u5e73\u53f0\uff0cJSON \u89e3\u6790\u5668\u548c JSON \u5e93\u652f\u6301\u8bb8\u591a\u4e0d\u540c\u7684\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n<p style=\"margin: 1em 0px;\">(3)JSON\u7684\u8bed\u6cd5\u8868\u793a\u4e09\u79cd\u7c7b\u578b\u503c\uff0c\u7b80\u5355\u503c(\u5b57\u7b26\u4e32\uff0c\u6570\u503c\uff0c\u5e03\u5c14\u503c\uff0cnull),\u6570\u7ec4\uff0c\u5bf9\u8c61<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">42. js\u4e2d\u76843\u79cd\u5f39\u51fa\u5f0f\u6d88\u606f\u63d0\u9192\uff08\u8b66\u544a\u7a97\u53e3\uff0c\u786e\u8ba4\u7a97\u53e3\uff0c\u4fe1\u606f\u8f93\u5165\u7a97\u53e3\uff09\u7684\u547d\u4ee4\u5f0f\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">alert confirm prompt<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">43. \u4ee5\u4e0b\u4ee3\u7801\u6267\u884c\u7ed3\u679c<\/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 uname = 'jack'\nfunction change() {\n    alert(uname) \/\/ ?\n    var uname = 'lily'\n    alert(uname)  \/\/?\n}\nchange()\n\u5206\u522balert\u51fa undefined\uff0clily\uff0c\uff08\u53d8\u91cf\u58f0\u660e\u63d0\u524d\u95ee\u9898\uff09\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">44. \u6d4f\u89c8\u5668\u7684\u6eda\u52a8\u8ddd\u79bb\uff1a<\/h3>\n<p style=\"margin: 1em 0px;\">\u53ef\u89c6\u533a\u57df\u8ddd\u79bb\u9875\u9762\u9876\u90e8\u7684\u8ddd\u79bb<\/p>\n<p style=\"margin: 1em 0px;\">scrollTop=document.documentElement.scrollTop||document.body.scrollTop<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">45. \u53ef\u89c6\u533a\u7684\u5927\u5c0f\uff1a<\/h3>\n<p style=\"margin: 1em 0px;\">(1)innerXXX\uff08\u4e0d\u517c\u5bb9ie\uff09<\/p>\n<p style=\"margin: 1em 0px;\">window.innerHeight \u53ef\u89c6\u533a\u9ad8\u5ea6\uff0c\u5305\u542b\u6eda\u52a8\u6761\u5bbd\u5ea6<\/p>\n<p style=\"margin: 1em 0px;\">window.innerWidth \u53ef\u89c6\u533a\u5bbd\u5ea6\uff0c\u5305\u542b\u6eda\u52a8\u6761\u5bbd\u5ea6<\/p>\n<p style=\"margin: 1em 0px;\">(2)document.documentElement.clientXXX(\u517c\u5bb9ie)<\/p>\n<p style=\"margin: 1em 0px;\">document.documentElement.clientWidth\u53ef\u89c6\u533a\u5bbd\u5ea6\uff0c\u4e0d\u5305\u542b\u6eda\u52a8\u6761\u5bbd\u5ea6<\/p>\n<p style=\"margin: 1em 0px;\">document.documentElement.clientHeight\u53ef\u89c6\u533a\u9ad8\u5ea6\uff0c\u4e0d\u5305\u542b\u6eda\u52a8\u6761\u5bbd\u5ea6<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">46. \u8282\u70b9\u7684\u79cd\u7c7b\u6709\u51e0\u79cd\uff0c\u5206\u522b\u662f\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">(1)\u5143\u7d20\u8282\u70b9\uff1anodeType ===1;<\/p>\n<p style=\"margin: 1em 0px;\">(2)\u6587\u672c\u8282\u70b9\uff1anodeType ===3;<\/p>\n<p style=\"margin: 1em 0px;\">(3)\u5c5e\u6027\u8282\u70b9\uff1anodeType ===2;<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">47. innerHTML\u548couterHTML\u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">innerHTML(\u5143\u7d20\u5185\u5305\u542b\u7684\u5185\u5bb9\uff09<\/p>\n<p style=\"margin: 1em 0px;\">outerHTML(\u81ea\u5df1\u4ee5\u53ca\u5143\u7d20\u5185\u7684\u5185\u5bb9\uff09<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">48. offsetWidth offsetHeight\u548cclientWidth clientHeight\u7684\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">(1)offsetWidth \uff08content\u5bbd\u5ea6+padding\u5bbd\u5ea6+border\u5bbd\u5ea6\uff09<\/p>\n<p style=\"margin: 1em 0px;\">(2)offsetHeight\uff08content\u9ad8\u5ea6+padding\u9ad8\u5ea6+border\u9ad8\u5ea6\uff09<\/p>\n<p style=\"margin: 1em 0px;\">(3)clientWidth\uff08content\u5bbd\u5ea6+padding\u5bbd\u5ea6\uff09<\/p>\n<p style=\"margin: 1em 0px;\">(4)clientHeight\uff08content\u9ad8\u5ea6+padding\u9ad8\u5ea6\uff09<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">49. \u95ed\u5305\u7684\u597d\u5904<\/h3>\n<p style=\"margin: 1em 0px;\">(1)\u5e0c\u671b\u4e00\u4e2a\u53d8\u91cf\u957f\u671f\u9a7b\u624e\u5728\u5185\u5b58\u5f53\u4e2d(\u4e0d\u88ab\u5783\u573e\u56de\u6536\u673a\u5236\u56de\u6536)<\/p>\n<p style=\"margin: 1em 0px;\">(2)\u907f\u514d\u5168\u5c40\u53d8\u91cf\u7684\u6c61\u67d3<\/p>\n<p style=\"margin: 1em 0px;\">(3)\u79c1\u6709\u6210\u5458\u7684\u5b58\u5728<\/p>\n<p style=\"margin: 1em 0px;\">(4)\u5b89\u5168\u6027\u63d0\u9ad8<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">50. \u5192\u6ce1\u6392\u5e8f\u7b97\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;\">\u5192\u6ce1\u6392\u5e8f\nvar array = [5, 4, 3, 2, 1];\nvar temp = 0;\nfor (var i = 0; i &lt;array.length; i++){\nfor (var j = 0; j &lt;array.length - i; j++){\nif (array[j] &gt; array[j + 1]){\ntemp = array[j + 1];\narray[j + 1] = array[j];\narray[j] = temp;\n }\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">51\u3001js \u5b9e\u73b0\u4e00\u4e2a\u51fd\u6570\u5bf9javascript\u4e2djson \u5bf9\u8c61\u8fdb\u884c\u514b\u9686<\/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 oldObject =\"sdf\";\n   var newObject = JSON.parse(JSON.stringify(oldObject));\n   console.log(newObject);\n\u6216\u8005\n    var a = 'dddd';\n    function cp(a){return JSON.parse(JSON.stringify(a))}\n    console.log(cp(a));\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">52\u3001js \u5b9e\u73b0 ajax \u8bf7\u6c42\u6216\u8005submit\u8bf7\u6c42\u65f6 \u9501\u5c4f\u529f\u80fd\u4ee5\u53ca\u5f00\u9501\u529f\u80fd\uff08\u8bf7\u6c42\u65f6\u754c\u9762Loading\u4ee5\u53ca\u5143\u7d20\u4e0d\u80fd\u70b9\u51fb\uff0c\u8bf7\u6c42\u5b8c\u6210\u5373\u6d88\u9664Loading\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">function(url, fn) { var obj = new XMLHttpRequest(); \/\/ XMLHttpRequest\u5bf9\u8c61\u7528\u4e8e\u5728\u540e\u53f0\u4e0e\u670d\u52a1\u5668\u4ea4\u6362\u6570\u636e obj.open(&#8216;GET&#8217;, url, true); obj.onreadystatechange = function() { if(obj.readyState == 4 &amp;&amp; obj.status == 200||obj.status == 304) {<\/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;\">               loading.style.display = \"none\"\n\n            } else {\n\n               alert(\"\u4e0d\u80fd\u70b9\u51fb,\u54c8\u54c8\u54c8!\");\n\n            }\n\n   };\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">obj.send(null); }<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">53\u3001js \u5b9e\u73b0\u4e00\u4e2a\u51fd\u6570 \u83b7\u5f97url\u53c2\u6570\u7684\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 getQueryString(name) { \n  var reg = new RegExp(\"(^|&amp;)\" + name + \"=([^&amp;]*)(&amp;|$)\", \"i\"); \n  var r = window.location.search.substr(1).match(reg); \n  if (r != null) return unescape(r[2]); return null; \n} \n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">54\u3001\u8bf7\u7528js\u8ba1\u7b971-10000\u4e2d\u51fa\u73b0\u76840 \u7684\u6b21\u6570<\/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;\">new Array(10000).fill('').map((_, index) =&gt; index + 1).filter(item =&gt; \/0\/.test(item)).reduce((count, item) =&gt; { return count + (String(item).match(\/0\/g) || []).length}, 0)\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">55\u3001\u5199\u4e00\u4e2afunction\uff0c\u6e05\u9664\u5b57\u7b26\u4e32\u524d\u540e\u7684\u7a7a\u683c\u3002\uff08\u517c\u5bb9\u6240\u6709\u6d4f\u89c8\u5668\uff09<\/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 trim(str) {\n    if (str &amp; typeof str === \"string\") {\n        return str.replace(\/(^s*)|(s*)$\/g,\"\"); \/\/\u53bb\u9664\u524d\u540e\u7a7a\u767d\u7b26\n    }\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">56\u3001\u964d\u7ef4\u6570\u7ec4<\/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 arr=[[1,2],[3,4]];\nfunction Jw(obj){\n     return Array.prototype.concat.apply([],obj);\n}\nJw(arr);\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">57\u3001\u5c06url\u7684\u67e5\u8be2\u53c2\u6570\u89e3\u6790\u6210\u5b57\u5178\u5bf9\u8c61<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 function getQueryObject(url) { url = url == null ? window.location.href : url; var search = url.substring(url.lastIndexOf(&#8220;?&#8221;) + 1); var obj = {}; var reg = \/([?&amp;=]+)=([?&amp;=]*)\/g; search.replace(reg, function (rs,<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/math.jianshu.com\/math?formula=1%2C\" alt=\"1,\" \/><\/p>\n<p style=\"margin: 1em 0px;\">2) { var name = decodeURIComponent(<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/math.jianshu.com\/math?formula=1\" alt=\"1); var val = decodeURIComponent(\" \/><\/p>\n<p style=\"margin: 1em 0px;\">%3B%20var%20val%20%3D%20decodeURIComponent()2); val = String(val); obj[name] = val; return rs; }); return obj; } \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">58\u3001\u5224\u65ad\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u51fa\u73b0\u6b21\u6570\u6700\u591a\u7684\u5b57\u7b26\uff0c\u7edf\u8ba1\u8fd9\u4e2a\u6b21\u6570<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 var str = &#8216;asdfssaaasasasasaa&#8217;; var json = {};<\/p>\n<p style=\"margin: 1em 0px;\">for (var i = 0; i &lt; str.length; i++) { if(!json[str.charAt(i)]){ json[str.charAt(i)] = 1; }else{ json[str.charAt(i)]++; } }; var iMax = 0; var iIndex = &#8221;; for(var i in json){ if(json[i]&gt;iMax){ iMax = json[i]; iIndex = i; } } alert(&#8216;\u51fa\u73b0\u6b21\u6570\u6700\u591a\u7684\u662f:&#8217;+iIndex+&#8217;\u51fa\u73b0&#8217;+iMax+&#8217;\u6b21&#8217;); \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">59\u3001\u7f16\u5199\u4e00\u4e2a\u65b9\u6cd5 \u6c42\u4e00\u4e2a\u5b57\u7b26\u4e32\u7684\u5b57\u8282\u957f\u5ea6;<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 \/\/\u5047\u8bbe\u4e00\u4e2a\u4e2d\u6587\u5360\u4e24\u4e2a\u5b57\u8282 var str = &#8217;22\u4e24\u662f&#8217;;<\/p>\n<p style=\"margin: 1em 0px;\">alert(getStrlen(str))<\/p>\n<p style=\"margin: 1em 0px;\">function getStrlen(str){ var json = {len:0}; var re = \/[\\u4e00-\\u9fa5]\/; for (var i = 0; i &lt; str.length; i++) { if(re.test(str.charAt(i))){ json[&#8216;len&#8217;]++; } }; return json[&#8216;len&#8217;]+str.length; } \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">60\u3001\u7f16\u5199\u4e00\u4e2a\u65b9\u6cd5 \u53bb\u6389\u4e00\u4e2a\u6570\u7ec4\u7684\u91cd\u590d\u5143\u7d20<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 var arr = [1,2,3,1,43,12,12,1]; var json = {}; var arr2 = []; for (var i = 0; i &lt; arr.length; i++) { if(!json[arr[i]]){ json[arr[i]] = true; }else{ json[arr[i]] = false; }<\/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;\">    if(json[arr[i]]){\n            arr2.push(arr[i]);\n    }\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">};<\/p>\n<p style=\"margin: 1em 0px;\">for (var i = 0; i &lt; arr.length; i++) { if(!aa(arr[i], arr2)){ arr2.push(arr[i]) } }; function aa(obj, arr){ for (var i = 0; i &lt; arr.length; i++) { if(arr[i] == obj) return true; else return false; }; } alert(arr2) \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">61\u3001\u5199\u51fa3\u4e2a\u4f7f\u7528this\u7684\u5178\u578b\u5e94\u7528<\/h3>\n<p style=\"margin: 1em 0px;\">\u4e8b\u4ef6\uff1a \u5982onclick this-&gt;\u53d1\u751f\u4e8b\u4ef6\u7684\u5bf9\u8c61 \u6784\u9020\u51fd\u6570 this-&gt;new \u51fa\u6765\u7684object call\/apply \u6539\u53d8this<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">62\u3001\u5982\u4f55\u6df1\u5ea6\u514b\u9686<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 var arr = [1,2,43]; var json = {a:6,b:4,c:[1,2,3]}; var str = &#8216;sdfsdf&#8217;;<\/p>\n<p style=\"margin: 1em 0px;\">var json2 = clone(json);<\/p>\n<p style=\"margin: 1em 0px;\">alert(json[&#8216;c&#8217;]) function clone(obj){ var oNew = new obj.constructor(obj.valueOf()); if(obj.constructor == Object){ for(var i in obj){ oNew[i] = obj[i]; if(typeof(oNew[i]) == &#8216;object&#8217;){ clone(oNew[i]); } } } return oNew; } \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">63\u3001JavaScript\u4e2d\u5982\u4f55\u68c0\u6d4b\u4e00\u4e2a\u53d8\u91cf\u662f\u4e00\u4e2aString\u7c7b\u578b\uff1f\u8bf7\u5199\u51fa\u51fd\u6570\u5b9e\u73b0<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 typeof(obj) == &#8216;string&#8217; obj.constructor == String; \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">64\u3001\u7f51\u9875\u4e2d\u5b9e\u73b0\u4e00\u4e2a\u8ba1\u7b97\u5f53\u5e74\u8fd8\u5269\u591a\u5c11\u65f6\u95f4\u7684\u5012\u6570\u8ba1\u65f6\u7a0b\u5e8f\uff0c\u8981\u6c42\u7f51\u9875\u4e0a\u5b9e\u65f6\u52a8\u6001\u663e\u793a\u201c\u00d7\u00d7\u5e74\u8fd8\u5269\u00d7\u00d7\u5929\u00d7\u00d7\u65f6\u00d7\u00d7\u5206\u00d7\u00d7\u79d2\u201d<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 var oDate = new Date(); var oYear = oDate.getFullYear();<\/p>\n<p style=\"margin: 1em 0px;\">var oNewDate = new Date(); oNewDate.setFullYear(oYear, 11, 31, 23, 59, 59); var iTime = oNewDate.getTime()-oDate.getTime();<\/p>\n<p style=\"margin: 1em 0px;\">var iS = iTime\/1000; var iM = oNewDate.getMonth()-oDate.getMonth(); var iDate =iS \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">65\u3001\u8bf7\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u8bed\u4e49\u5316\u7684HTML\u3002<\/h3>\n<p style=\"margin: 1em 0px;\">\u5185\u5bb9\u4f7f\u7528\u7279\u5b9a\u6807\u7b7e\uff0c\u901a\u8fc7\u6807\u7b7e\u5c31\u80fd\u5927\u6982\u4e86\u89e3\u6574\u4f53\u9875\u9762\u7684\u5e03\u5c40\u5206\u5e03<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">66\u3001\u4e3a\u4ec0\u4e48\u5229\u7528\u591a\u4e2a\u57df\u540d\u6765\u5b58\u50a8\u7f51\u7ad9\u8d44\u6e90\u4f1a\u66f4\u6709\u6548\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u786e\u4fdd\u7528\u6237\u5728\u4e0d\u540c\u5730\u533a\u80fd\u7528\u6700\u5feb\u7684\u901f\u5ea6\u6253\u5f00\u7f51\u7ad9\uff0c\u5176\u4e2d\u67d0\u4e2a\u57df\u540d\u5d29\u6e83\u7528\u6237\u4e5f\u80fd\u901a\u8fc7\u5176\u4ed6\u90c1\u95f7\u8bbf\u95ee\u7f51\u7ad9<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">67\u3001\u8bf7\u8bf4\u51fa\u4e09\u79cd\u51cf\u4f4e\u9875\u9762\u52a0\u8f7d\u65f6\u95f4\u7684\u65b9\u6cd5<\/h3>\n<p style=\"margin: 1em 0px;\">1\u3001\u538b\u7f29css\u3001js\u6587\u4ef6<\/p>\n<p style=\"margin: 1em 0px;\">2\u3001\u5408\u5e76js\u3001css\u6587\u4ef6\uff0c\u51cf\u5c11http\u8bf7\u6c42<\/p>\n<p style=\"margin: 1em 0px;\">3\u3001\u5916\u90e8js\u3001css\u6587\u4ef6\u653e\u5728\u6700\u5e95\u4e0b<\/p>\n<p style=\"margin: 1em 0px;\">4\u3001\u51cf\u5c11dom\u64cd\u4f5c\uff0c\u5c3d\u53ef\u80fd\u7528\u53d8\u91cf\u66ff\u4ee3\u4e0d\u5fc5\u8981\u7684dom\u64cd\u4f5c<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">68\u3001\u4ec0\u4e48\u662fFOUC\uff1f\u4f60\u5982\u4f55\u6765\u907f\u514dFOUC\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u7531\u4e8ecss\u5f15\u5165\u4f7f\u7528\u4e86@import \u6216\u8005\u5b58\u5728\u591a\u4e2astyle\u6807\u7b7e\u4ee5\u53cacss\u6587\u4ef6\u5728\u9875\u9762\u5e95\u90e8\u5f15\u5165\u4f7f\u5f97css\u6587\u4ef6\u52a0\u8f7d\u5728html\u4e4b\u540e\u5bfc\u81f4\u9875\u9762\u95ea\u70c1\u3001\u82b1\u5c4f \u7528link\u52a0\u8f7dcss\u6587\u4ef6\uff0c\u653e\u5728head\u6807\u7b7e\u91cc\u9762<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">69\u3001\u6587\u6863\u7c7b\u578b\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f\u4f60\u77e5\u9053\u591a\u5c11\u79cd\u6587\u6863\u7c7b\u578b\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u5f71\u54cd\u6d4f\u89c8\u5668\u5bf9html\u4ee3\u7801\u7684\u7f16\u8bd1\u6e32\u67d3 html2.0 xHtml html5<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">70\u3001\u6d4f\u89c8\u5668\u6807\u51c6\u6a21\u5f0f\u548c\u602a\u5f02\u6a21\u5f0f\u4e4b\u95f4\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u76d2\u6a21\u578b\u89e3\u91ca\u4e0d\u540c<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">71\u3001\u95ed\u5305<\/h3>\n<p style=\"margin: 1em 0px;\">\u5b50\u51fd\u6570\u80fd\u88ab\u5916\u90e8\u8c03\u7528\u5230\uff0c\u5219\u8be5\u4f5c\u7528\u8fde\u4e0a\u7684\u6240\u6709\u53d8\u91cf\u90fd\u4f1a\u88ab\u4fdd\u5b58\u4e0b\u6765\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">72\u3001\u8bf7\u89e3\u91ca\u4ec0\u4e48\u662fJavascript\u7684\u6a21\u5757\u6a21\u5f0f\uff0c\u5e76\u4e3e\u51fa\u5b9e\u7528\u5b9e\u4f8b\u3002<\/h3>\n<p style=\"margin: 1em 0px;\">js\u6a21\u5757\u5316mvc\uff08\u6570\u636e\u5c42\u3001\u8868\u73b0\u5c42\u3001\u63a7\u5236\u5c42\uff09 seajs \u547d\u540d\u7a7a\u95f4<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">73\u3001\u4f60\u5982\u4f55\u7ec4\u7ec7\u81ea\u5df1\u7684\u4ee3\u7801\uff1f\u662f\u4f7f\u7528\u6a21\u5757\u6a21\u5f0f\uff0c\u8fd8\u662f\u4f7f\u7528\u7ecf\u5178\u7ee7\u627f\u7684\u65b9\u6cd5\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u5bf9\u5185\uff1a\u6a21\u5757\u6a21\u5f0f \u5bf9\u5916\uff1a\u7ee7\u627f<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">74\u3001\u4f60\u5982\u4f55\u4f18\u5316\u81ea\u5df1\u7684\u4ee3\u7801\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u4ee3\u7801\u91cd\u7528 \u907f\u514d\u5168\u5c40\u53d8\u91cf\uff08\u547d\u540d\u7a7a\u95f4\uff0c\u5c01\u95ed\u7a7a\u95f4\uff0c\u6a21\u5757\u5316mvc..\uff09 \u62c6\u5206\u51fd\u6570\u907f\u514d\u51fd\u6570\u8fc7\u4e8e\u81c3\u80bf \u6ce8\u91ca<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">75\u3001\u4f60\u80fd\u89e3\u91ca\u4e00\u4e0bJavaScript\u4e2d\u7684\u7ee7\u627f\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u5417\uff1f<\/h3>\n<p style=\"margin: 1em 0px;\">\u5b50\u6784\u9020\u51fd\u6570\u4e2d\u6267\u884c\u7236\u6784\u9020\u51fd\u6570\uff0c\u5e76\u7528call\\apply\u6539\u53d8this \u514b\u9686\u7236\u6784\u9020\u51fd\u6570\u539f\u578b\u4e0a\u7684\u65b9\u6cd5<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">76\u3001\u8bf7\u5c3d\u53ef\u80fd\u8be6\u5c3d\u7684\u89e3\u91caAJAX\u7684\u5de5\u4f5c\u539f\u7406\u3002<\/h3>\n<p style=\"margin: 1em 0px;\">\u521b\u5efaajax\u5bf9\u8c61\uff08XMLHttpRequest\/ActiveXObject(Microsoft.XMLHttp)\uff09 \u5224\u65ad\u6570\u636e\u4f20\u8f93\u65b9\u5f0f(GET\/POST) \u6253\u5f00\u94fe\u63a5 open() \u53d1\u9001 send() \u5f53ajax\u5bf9\u8c61\u5b8c\u6210\u7b2c\u56db\u6b65\uff08onreadystatechange\uff09\u6570\u636e\u63a5\u6536\u5b8c\u6210\uff0c\u5224\u65adhttp\u54cd\u5e94\u72b6\u6001\uff08status\uff09200-300\u4e4b\u95f4\u6216\u8005304\uff08\u7f13\u5b58\uff09\u6267\u884c\u56de\u8c03\u51fd\u6570<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">77\u3001\u6700\u7b80\u5355\u7684\u4e00\u9053\u9898<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 var a = 2, b = 3; var c = a+++b; \/\/ c = 5 \u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">78\u3001var\u548cfunction\u7684\u9884\u89e3\u6790\u95ee\u9898,\u4ee5\u53ca\u53d8\u91cf\u548cfunction\u7684\u5148\u540e\u987a\u5e8f\u7684\u95ee\u9898<\/h3>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7 \/\/ \u4ee5\u4e0b\u4ee3\u7801\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u662f\u4ec0\u4e48 function b () { console.log(a); var a = 10; function a() {}; a = 100; console.log(a); } b();<\/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 c () {\n    console.log(a);\n    function a() {};\n    var a = 10;\n    a = 100;\n    console.log(a);\n}\nc();\n\n(function d (num) {\n    console.log(num);\n    var num = 10;\n}(100))\n\n(function e (num) {\n    console.log(num);\n    var num = 10;\n    function num () {};\n}(100))\n\n(function f (num) {\n    function num () {};\n    console.log(num);\n    var num =10\n    console.log(num);\n}(100))\n\n\/\/\u4ecd\u7136\u662f\u9884\u89e3\u6790(\u5728\u4e0e\u89e3\u6790\u8fc7\u7a0b\u4e2d\u8fd8\u8981\u8003\u8651\u4e00\u4e0b\u5f53\u524d\u53d8\u91cf\u7684\u4f5c\u7528\u4e8e)\nfunction m () {\n    console.log(a1); \/\/ underfined\n    console.log(a2); \/\/ underfined\n    console.log(b1); \/\/ underfined\n    console.log(b2); \/\/ underfined\n    if(false) {\n        function b1 (){};\n        var a1 = 10;\n    }\n    if(true) {\n        function b2 (){};\n        var a2 = 10;\n    }\n    console.log(a1); \/\/ underfined\n    console.log(a2); \/\/ 10\n    console.log(b1); \/\/ underfined\n    console.log(b2); \/\/ function\n}\nm();\n\nfunction n() {\n    if(2&gt;1) {\n        arr = 10;\n        brr = 10;\n        let arr;\n        var brr;\n        console.log(arr);\n        console.log(brr);\n    }\n}\nn(); \/\/ ReferenceError\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u00b7\u00b7\u00b7<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">79\u3001dom\u4e8b\u4ef6\u59d4\u6258\u4ec0\u4e48\u539f\u7406\uff0c\u6709\u4ec0\u4e48\u4f18\u7f3a\u70b9<\/h3>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4e8b\u4ef6\u59d4\u6258\u539f\u7406:\u4e8b\u4ef6\u5192\u6ce1\u673a\u5236<\/h3>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4f18\u70b9<\/h3>\n<p style=\"margin: 1em 0px;\">1.\u53ef\u4ee5\u5927\u91cf\u8282\u7701\u5185\u5b58\u5360\u7528\uff0c\u51cf\u5c11\u4e8b\u4ef6\u6ce8\u518c\u3002\u6bd4\u5982ul\u4e0a\u4ee3\u7406\u6240\u6709li\u7684click\u4e8b\u4ef6\u5c31\u5f88\u4e0d\u9519\u3002<\/p>\n<p style=\"margin: 1em 0px;\">2.\u53ef\u4ee5\u5b9e\u73b0\u5f53\u65b0\u589e\u5b50\u5bf9\u8c61\u65f6\uff0c\u65e0\u9700\u518d\u5bf9\u5176\u8fdb\u884c\u4e8b\u4ef6\u7ed1\u5b9a\uff0c\u5bf9\u4e8e\u52a8\u6001\u5185\u5bb9\u90e8\u5206\u5c24\u4e3a\u5408\u9002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u7f3a\u70b9<\/h3>\n<p style=\"margin: 1em 0px;\">\u4e8b\u4ef6\u4ee3\u7406\u7684\u5e38\u7528\u5e94\u7528\u5e94\u8be5\u4ec5\u9650\u4e8e\u4e0a\u8ff0\u9700\u6c42\uff0c\u5982\u679c\u628a\u6240\u6709\u4e8b\u4ef6\u90fd\u7528\u4e8b\u4ef6\u4ee3\u7406\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e8b\u4ef6\u8bef\u5224\u3002\u5373\u672c\u4e0d\u8be5\u88ab\u89e6\u53d1\u7684\u4e8b\u4ef6\u88ab\u7ed1\u5b9a\u4e0a\u4e86\u4e8b\u4ef6\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">80\u3001http\u7684cache\u673a\u5236\uff0c\u4ee5\u53ca200\u72b6\u6001\u4e0b\u600e\u4e48\u5b9e\u73b0 from cache\uff08\u8868\u793a\u63a5\u89e6\u6700\u591a\u7684\u5c31\u662f304\u7684from cache\uff09\uff08\u7528\u4e8e\u4f18\u5316\uff0c\u6ca1\u6709\u63a5\u89e6\u8fc7\uff0c\u9700\u8981\u7406\u89e3\uff09<\/h3>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u542b\u4e49<\/h3>\n<p style=\"margin: 1em 0px;\">\u5b9a\u4e49\uff1a\u6d4f\u89c8\u5668\u7f13\u5b58\uff08Browser Caching\uff09\u662f\u4e3a\u4e86\u52a0\u901f\u6d4f\u89c8\uff0c\u6d4f\u89c8\u5668\u5728\u7528\u6237\u78c1\u76d8\u4e0a\u5bf9\u6700\u8fd1\u8bf7\u6c42\u8fc7\u7684\u6587\u6863\u8fdb\u884c\u5b58\u50a8\uff0c\u5f53\u8bbf\u95ee\u8005\u518d\u6b21\u8bf7\u6c42\u8fd9\u4e2a\u9875\u9762\u65f6\uff0c\u6d4f\u89c8\u5668\u5c31\u53ef\u4ee5\u4ece\u672c\u5730\u78c1\u76d8\u663e\u793a\u6587\u6863\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u52a0\u901f\u9875\u9762\u7684\u9605\u89c8\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4f5c\u7528<\/h3>\n<p style=\"margin: 1em 0px;\">cache\u7684\u4f5c\u7528\uff1a<\/p>\n<p style=\"margin: 1em 0px;\">1\u3001\u51cf\u5c11\u5ef6\u8fdf\uff0c\u8ba9\u4f60\u7684\u7f51\u7ad9\u66f4\u5feb\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<p style=\"margin: 1em 0px;\">2\u3001\u907f\u514d\u7f51\u7edc\u62e5\u585e\uff0c\u51cf\u5c11\u8bf7\u6c42\u91cf\uff0c\u51cf\u5c11\u8f93\u51fa\u5e26\u5bbd\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u5b9e\u73b0\u624b\u6bb5<\/h3>\n<p style=\"margin: 1em 0px;\">Cache-Control\u4e2d\u7684max-age\u662f\u5b9e\u73b0\u5185\u5bb9cache\u7684\u4e3b\u8981\u624b\u6bb5\uff0c\u5171\u67093\u79cd\u5e38\u7528\u7b56\u7565\uff1amax-age\u548cLast-Modified\uff08If-Modified-Since\uff09\u7684\u7ec4\u5408\u3001\u4ec5max-age\u3001max-age\u548cETag\u7684\u7ec4\u5408\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5bf9\u4e8e\u5f3a\u5236\u7f13\u5b58\uff0c\u670d\u52a1\u5668\u901a\u77e5\u6d4f\u89c8\u5668\u4e00\u4e2a\u7f13\u5b58\u65f6\u95f4\uff0c\u5728\u7f13\u5b58\u65f6\u95f4\u5185\uff0c\u4e0b\u6b21\u8bf7\u6c42\uff0c\u76f4\u63a5\u7528\u7f13\u5b58\uff0c\u4e0d\u5728\u65f6\u95f4\u5185\uff0c\u6267\u884c\u6bd4\u8f83\u7f13\u5b58\u7b56\u7565\u3002 \u5bf9\u4e8e\u6bd4\u8f83\u7f13\u5b58\uff0c\u5c06\u7f13\u5b58\u4fe1\u606f\u4e2d\u7684Etag\u548cLast-Modified\u901a\u8fc7\u8bf7\u6c42\u53d1\u9001\u7ed9\u670d\u52a1\u5668\uff0c\u7531\u670d\u52a1\u5668\u6821\u9a8c\uff0c\u8fd4\u56de304\u72b6\u6001\u7801\u65f6\uff0c\u6d4f\u89c8\u5668\u76f4\u63a5\u4f7f\u7528\u7f13\u5b58\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">81\u3001\u4e00\u4e2a\u539f\u578b\u94fe\u7ee7\u627f\u7684\u95ee\u9898<\/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;\">    \/\/ \u6709\u4e00\u4e2a\u6784\u9020\u51fd\u6570A\uff0c\u5199\u4e00\u4e2a\u51fd\u6570B\uff0c\u7ee7\u627fA\n    function A (num) {\n        this.titileName = num;\n    }\n    A.prototype = {\n        fn1: function () {},\n        fn2: function () {}\n    }\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u8fd9\u4e2a\u95ee\u9898\u7684\u5173\u6ce8\u70b9\u662fB\u7ee7\u627f\u7684A\u7684\u9759\u6001\u5c5e\u6027\uff0c\u540c\u65f6B\u7684\u539f\u578b\u94fe\u4e2d\u4e0d\u5b58\u5728A\u5b9e\u4f8b\u7684titleName\u5c5e\u6027<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">82\u3001\u4ec0\u4e48\u662f\u865a\u62dfdom<\/h3>\n<p style=\"margin: 1em 0px;\">React\u4e3a\u5565\u8fd9\u4e48\u5927\uff1f\u56e0\u4e3a\u5b83\u5b9e\u73b0\u4e86\u4e00\u4e2a\u865a\u62dfDOM\uff08Virtual DOM\uff09\u3002\u865a\u62dfDOM\u662f\u5e72\u4ec0\u4e48\u7684\uff1f\u8fd9\u5c31\u8981\u4ece\u6d4f\u89c8\u5668\u672c\u8eab\u8bb2\u8d77<\/p>\n<p style=\"margin: 1em 0px;\">\u5982\u6211\u4eec\u6240\u77e5\uff0c\u5728\u6d4f\u89c8\u5668\u6e32\u67d3\u7f51\u9875\u7684\u8fc7\u7a0b\u4e2d\uff0c\u52a0\u8f7d\u5230HTML\u6587\u6863\u540e\uff0c\u4f1a\u5c06\u6587\u6863\u89e3\u6790\u5e76\u6784\u5efaDOM\u6811\uff0c\u7136\u540e\u5c06\u5176\u4e0e\u89e3\u6790CSS\u751f\u6210\u7684CSSOM\u6811\u4e00\u8d77\u7ed3\u5408\u4ea7\u751f\u7231\u7684\u7ed3\u6676\u2014\u2014RenderObject\u6811\uff0c\u7136\u540e\u5c06RenderObject\u6811\u6e32\u67d3\u6210\u9875\u9762\uff08\u5f53\u7136\u4e2d\u95f4\u53ef\u80fd\u4f1a\u6709\u4e00\u4e9b\u4f18\u5316\uff0c\u6bd4\u5982RenderLayer\u6811\uff09\u3002\u8fd9\u4e9b\u8fc7\u7a0b\u90fd\u5b58\u5728\u4e0e\u6e32\u67d3\u5f15\u64ce\u4e4b\u4e2d\uff0c\u6e32\u67d3\u5f15\u64ce\u5728\u6d4f\u89c8\u5668\u4e2d\u662f\u4e8eJavaScript\u5f15\u64ce\uff08JavaScriptCore\u4e5f\u597dV8\u4e5f\u597d\uff09\u5206\u79bb\u5f00\u7684\uff0c\u4f46\u4e3a\u4e86\u65b9\u4fbfJS\u64cd\u4f5cDOM\u7ed3\u6784\uff0c\u6e32\u67d3\u5f15\u64ce\u4f1a\u66b4\u9732\u4e00\u4e9b\u63a5\u53e3\u4f9bJavaScript\u8c03\u7528\u3002\u7531\u4e8e\u8fd9\u4e24\u5757\u76f8\u4e92\u5206\u79bb\uff0c\u901a\u4fe1\u662f\u9700\u8981\u4ed8\u51fa\u4ee3\u4ef7\u7684\uff0c\u56e0\u6b64JavaScript\u8c03\u7528DOM\u63d0\u4f9b\u7684\u63a5\u53e3\u6027\u80fd\u4e0d\u548b\u5730\u3002\u5404\u79cd\u6027\u80fd\u4f18\u5316\u7684\u6700\u4f73\u5b9e\u8df5\u4e5f\u90fd\u5728\u5c3d\u53ef\u80fd\u7684\u51cf\u5c11DOM\u64cd\u4f5c\u6b21\u6570\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u800c\u865a\u62dfDOM\u5e72\u4e86\u4ec0\u4e48\uff1f\u5b83\u76f4\u63a5\u7528JavaScript\u5b9e\u73b0\u4e86DOM\u6811\uff08\u5927\u81f4\u4e0a\uff09\u3002\u7ec4\u4ef6\u7684HTML\u7ed3\u6784\u5e76\u4e0d\u4f1a\u76f4\u63a5\u751f\u6210DOM\uff0c\u800c\u662f\u6620\u5c04\u751f\u6210\u865a\u62df\u7684JavaScript DOM\u7ed3\u6784\uff0cReact\u53c8\u901a\u8fc7\u5728\u8fd9\u4e2a\u865a\u62dfDOM\u4e0a\u5b9e\u73b0\u4e86\u4e00\u4e2a diff \u7b97\u6cd5\u627e\u51fa\u6700\u5c0f\u53d8\u66f4\uff0c\u518d\u628a\u8fd9\u4e9b\u53d8\u66f4\u5199\u5165\u5b9e\u9645\u7684DOM\u4e2d\u3002\u8fd9\u4e2a\u865a\u62dfDOM\u4ee5JS\u7ed3\u6784\u7684\u5f62\u5f0f\u5b58\u5728\uff0c\u8ba1\u7b97\u6027\u80fd\u4f1a\u6bd4\u8f83\u597d\uff0c\u800c\u4e14\u7531\u4e8e\u51cf\u5c11\u4e86\u5b9e\u9645DOM\u64cd\u4f5c\u6b21\u6570\uff0c\u6027\u80fd\u4f1a\u6709\u8f83\u5927\u63d0\u5347<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">83\u3001js\u57fa\u7840\u6570\u636e\u7c7b\u578b\u548c\u5f15\u7528\u7c7b\u578b\u5206\u522b\u662f\u4ec0\u4e48\uff1f\u8fd9\u4e2a\u524d\u63d0\u6761\u4ef6\u4e0b\u5199\u4e00\u4e2agetType\uff0c\u8fd4\u56de\u76f8\u5e94\u7684\u7c7b\u578b<\/h3>\n<p style=\"margin: 1em 0px;\">1.\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08\u81ea\u8eab\u4e0d\u53ef\u62c6\u5206\u7684\uff09\uff1aUndefined\u3001Null\u3001Boolean\u3001Number\u3001String<\/p>\n<p style=\"margin: 1em 0px;\">2.\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u5bf9\u8c61\uff09\uff1aObject \uff08Array\uff0cDate\uff0cRegExp\uff0cFunction\uff09<\/p>\n<p style=\"margin: 1em 0px;\">ES6\u57fa\u672c\u6570\u636e\u7c7b\u578b\u591a\u4e86\u4e2asymbol \u636e\u8bf4\u8fd9\u9053\u9898\u5237\u4e86\u767e\u5206\u4e4b\u4e8c\u5341\u7684\u4eba \u611f\u8c22Abbyshen\u63d0\u51fa<\/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 gettype(nm){\n    return Object.prototype.toString.call(nm);\n}\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">84\u3001 dom\u9009\u62e9\u5668\u4f18\u5148\u7ea7\u662f\u4ec0\u4e48\uff0c\u4ee5\u53ca\u6743\u91cd\u503c\u8ba1\u7b97\uff08\u4e00\u9053\u8001\u95ee\u9898\u4e86\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">1.\u884c\u5185\u6837\u5f0f 1000<\/p>\n<p style=\"margin: 1em 0px;\">2.id 0100<\/p>\n<p style=\"margin: 1em 0px;\">3.\u7c7b\u9009\u62e9\u5668\u3001\u4f2a\u7c7b\u9009\u62e9\u5668\u3001\u5c5e\u6027\u9009\u62e9\u5668[type=&#8221;text&#8221;] 0010<\/p>\n<p style=\"margin: 1em 0px;\">4.\u6807\u7b7e\u9009\u62e9\u5668\u3001\u4f2a\u5143\u7d20\u9009\u62e9\u5668(::first-line) 0001<\/p>\n<p style=\"margin: 1em 0px;\">5.\u901a\u914d\u7b26*\u3001\u5b50\u9009\u62e9\u5668\u3001\u76f8\u90bb\u9009\u62e9\u5668 0000<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">85\u3001vue\u53cc\u5411\u6570\u636e\u7ed1\u5b9a\u7684\u539f\u7406\u662f\u4ec0\u4e48<\/h3>\n<p style=\"margin: 1em 0px;\">\u9996\u5148\u4f20\u8f93\u5bf9\u8c61\u7684\u53cc\u5411\u6570\u636e\u7ed1\u5b9a Object.defineProperty(target, key, decription),\u5728decription\u4e2d\u8bbe\u7f6eget\u548cset\u5c5e\u6027\uff08\u6b64\u65f6\u5e94\u6ce8\u610fdescription\u4e2dget\u548cset\u4e0d\u80fd\u4e0e\u63cf\u8ff0\u5c5e\u6027\u5171\u5b58\uff09 \u6570\u7ec4\u7684\u5b9e\u73b0\u4e0e\u5bf9\u8c61\u4e0d\u540c\u3002 \u540c\u65f6\u8fd0\u7528\u89c2\u5bdf\u8005\u6a21\u5f0f\u5b9e\u73b0wather\uff0c\u7528\u6237\u6570\u636e\u548cview\u89c6\u56fe\u7684\u66f4\u65b0<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">86\u3001 react\u548cvue\u6bd4\u8f83\u6765\u8bf4\u6709\u4ec0\u4e48\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">1 component\u5c42\u9762\uff0cweb component\u548cvirtual dom 2 \u6570\u636e\u7ed1\u5b9a\uff08vue\u53cc\u5411\uff0creact\u7684\u5355\u5411\uff09\u7b49\u597d\u591a 3 \u8ba1\u7b97\u5c5e\u6027 vue \u6709\uff0c\u63d0\u4f9b\u65b9\u4fbf\uff1b\u800c react \u4e0d\u884c 4 vue \u53ef\u4ee5 watch \u4e00\u4e2a\u6570\u636e\u9879\uff1b\u800c react \u4e0d\u884c 5 vue \u7531\u4e8e\u63d0\u4f9b\u7684 direct \u7279\u522b\u662f\u9884\u7f6e\u7684 directive \u56e0\u4e3a\u573a\u666f\u573a\u666f\u5f00\u53d1\u66f4\u5bb9\u6613\uff1breact \u6ca1\u6709 6 \u751f\u547d\u5468\u671f\u51fd\u6570\u540d\u592a\u957f directive<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">87\u3001git\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u4f60\u5728\u5f00\u53d1\u7740\u4e1a\u52a1\uff0c\u7a81\u7136\u53e6\u4e00\u4e2a\u5206\u652f\u6709\u4e00\u4e2abug\u8981\u6539\uff0c\u4f60\u600e\u4e48\u529e<\/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;\">git stash       \/\/\u5c06\u672c\u6b21\u4fee\u6539\u5b58\u5230\u6682\u5b58\u533a\uff08\u7d27\u6025\u5207\u6362\u5206\u652f\u65f6\uff09\ngit stash pop   \/\/\u5c06\u6240\u6709\u6682\u5b58\u533a\u7684\u5185\u5bb9\u53d6\u51fa\u6765\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">88\u3001 \u7f51\u9875\u5e03\u5c40\u6709\u54ea\u51e0\u79cd\uff0c\u6709\u4ec0\u4e48\u533a\u522b<\/h3>\n<p style=\"margin: 1em 0px;\">\u9759\u6001\u3001\u81ea\u9002\u5e94\u3001\u6d41\u5f0f\u3001\u54cd\u5e94\u5f0f\u56db\u79cd\u7f51\u9875\u5e03\u5c40 \u9759\u6001\u5e03\u5c40\uff1a\u610f\u601d\u5c31\u662f\u4e0d\u7ba1\u6d4f\u89c8\u5668\u5c3a\u5bf8\u5177\u4f53\u662f\u591a\u5c11\uff0c\u7f51\u9875\u5e03\u5c40\u5c31\u6309\u7167\u5f53\u65f6\u5199\u4ee3\u7801\u7684\u5e03\u5c40\u6765\u5e03\u7f6e\uff1b \u81ea\u9002\u5e94\u5e03\u5c40\uff1a\u5c31\u662f\u8bf4\u4f60\u770b\u5230\u7684\u9875\u9762\uff0c\u91cc\u9762\u5143\u7d20\u7684\u4f4d\u7f6e\u4f1a\u53d8\u5316\u800c\u5927\u5c0f\u4e0d\u4f1a\u53d8\u5316\uff1b \u6d41\u5f0f\u5e03\u5c40\uff1a\u4f60\u770b\u5230\u7684\u9875\u9762\uff0c\u5143\u7d20\u7684\u5927\u5c0f\u4f1a\u53d8\u5316\u800c\u4f4d\u7f6e\u4e0d\u4f1a\u53d8\u5316\u2014\u2014\u8fd9\u5c31\u5bfc\u81f4\u5982\u679c\u5c4f\u5e55\u592a\u5927\u6216\u8005\u592a\u5c0f\u90fd\u4f1a\u5bfc\u81f4\u5143\u7d20\u65e0\u6cd5\u6b63\u5e38\u663e\u793a\u3002 \u81ea\u9002\u5e94\u5e03\u5c40\uff1a\u6bcf\u4e2a\u5c4f\u5e55\u5206\u8fa8\u7387\u4e0b\u9762\u4f1a\u6709\u4e00\u4e2a\u5e03\u5c40\u6837\u5f0f\uff0c\u540c\u65f6\u4f4d\u7f6e\u4f1a\u53d8\u800c\u4e14\u5927\u5c0f\u4e5f\u4f1a\u53d8\u3002<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">89\u3001\u6267\u884c\u4e0b\u9762\u4ee3\u7801<\/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 a = {};\nvar b = {key: 'b'};\nvar c = {key: 'c'};\nvar d = [3,5,6];\na[b] = 123;\na<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">[c][\/c]<\/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;\">= 345; a[d] = 333; console.log(a[b]); \/\/ 345 console.log(a<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">[c][\/c]<\/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;\">); \/\/ 345 console.log(a[d]); \/\/ 333 <\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">90\u3001<\/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 R = (function() {\n        var u = {a:1,b:2};\n        var r = {\n            fn: function(k) {\n                return u[k];\n            }\n        }\n        return r;\n    }());\n    R.fn('a');  \/\/ 1\n<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u5982\u4f55\u83b7\u53d6\u533f\u540d\u51fd\u6570\u4e2d\u7684u<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">91\u3001\u4e0d\u9002\u7528\u5faa\u73af\u8bed\u53e5\uff08\u5305\u62ecmap\u3001forEach\u65b9\u6cd5\uff09\u5b9e\u73b0\u4e00\u4e2a100\u957f\u5ea6\u7684\u6570\u7ec4\uff0c\u7d22\u5f15\u503c\u548c\u503c\u76f8\u540c\u7684\u6570\u7ec4[0,1,2,3,4,5&#8230;&#8230;..99]<\/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 arr = new Array(100);\n\/\/\u65b9\u6cd51\n[...arr.keys()];\n\/\/\u65b9\u6cd5\u4e8c\nArray.from(arr.keys());\n\n\/\/\u65b9\u6cd5\u4e09\nArray.from({length: 100});\n\n\/\/ \u65b9\u6cd5\u56db \u501f\u52a9string\nvar arr1 = new Array(101);\nvar str = arr1.join('1,');\nstr = str.replace(\/(1\\,)\/g, function ($0, $1, index) {\n    var start = '' + Math.ceil(index\/2);\n    if(index &lt; str.length - 2) {\n        start += ','\n    }\n    return start;\n});\nreturn str.split(',');\n\n\/\/ \u65b9\u6cd5\u4e94\uff08\u51fd\u6570\u5f0f\uff0c\u53c2\u8003\u7f51\u7edc\uff09\nfunction reduce(arr, val) {\n    if(Object.prototype.toString.apply(val)){\n        return;\n    }\n    if(val &gt;= 100) {\n        return arr;\n    }\n    arr.push(val);\n    return reduce(arr, val+1);\n}\nvar res = reduce([], 0)\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">92\u3001\u4e0b\u9762\u8bed\u53e5\u6267\u884c\u7ed3\u679c\u8f93\u51fa<\/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 a = function (val, index) {\n    console.log(index);\n    return {\n        fn: function (name) {\n            return a(name, val);\n        }\n    }\n}\n\nvar b = a(0); \/\/ underfined\nb.fn(1); \/\/ 0\nb.fn(2); \/\/ 0\nb.fn(3); \/\/ 0\n<\/code><\/pre>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">93\u3001\u79d1\u666e<\/h3>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem;\">\n<li>\n<section>dom\u8282\u70b9\u7684\u6839\u8282\u70b9\u662f\u4e0d\u662fbody<br \/>\n\u56de\u7b54\uff1a \u4e0d\u662f\uff0cdom\u8282\u70b9\u7684\u6839\u8282\u70b9\u662fhtml(\u5305\u542bhead\u548cbody\uff0chead\u4e2d\u5206\u4e3ameta\u3001title\u7b49\u3002body\u53c8\u5206\u4e3a\u4e00\u7ec4)<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">2\uff09dom\u5143\u7d20\u90fd\u4f1a\u6709offsetParent\u5417 \u56de\u7b54\uff1a offsetParent\u5c5e\u6027\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\u7684\u5f15\u7528\uff0c\u8fd9\u4e2a\u5bf9\u8c61\u662f\u8ddd\u79bb\u8c03\u7528offsetParent\u7684\u5143\u7d20\u6700\u8fd1\u7684\uff08\u5728\u5305\u542b\u5c42\u6b21\u4e2d\u6700\u9760\u8fd1\u7684\uff09\uff0c\u5e76\u4e14\u662f\u5df2\u8fdb\u884c\u8fc7CSS\u5b9a\u4f4d\u7684\u5bb9\u5668\u5143\u7d20\u3002 \u5982\u679c\u8fd9\u4e2a\u5bb9\u5668\u5143\u7d20\u672a\u8fdb\u884cCSS\u5b9a\u4f4d, \u5219offsetParent\u5c5e\u6027\u7684\u53d6\u503c\u4e3a\u6839\u5143\u7d20(\u5728\u6807\u51c6\u517c\u5bb9\u6a21\u5f0f\u4e0b\u4e3ahtml\u5143\u7d20\uff1b\u5728\u602a\u5f02\u5448\u73b0\u6a21\u5f0f\u4e0b\u4e3abody\u5143\u7d20)\u7684\u5f15\u7528\u3002 \u5f53\u5bb9\u5668\u5143\u7d20\u7684style.display \u88ab\u8bbe\u7f6e\u4e3a &#8220;none&#8221;\u65f6\uff08\u8bd1\u6ce8\uff1aIE\u548cOpera\u9664\u5916\uff09\uff0coffsetParent\u5c5e\u6027 \u8fd4\u56de null\u3002<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem;\">\n<li>\n<section>[1,3,5]\u8f6c\u8bd1\u6210\u5b57\u7b26\u4e32\u662f\u4ec0\u4e48<br \/>\n\u56de\u7b54\uff1a &#8216;1,3,5&#8217;<br \/>\n\u8c03\u7528toString\u65b9\u6cd5\uff0c\u751f\u6210\u8be5\u5b57\u7b26\u4e32<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">4\uff09li\u6807\u7b7e\u7684\u7956\u7ea7\u5143\u7d20\u53ef\u4ee5\u4e3ali\uff0c\u7236\u7ea7\u5143\u7d20\u4e5f\u53ef\u4ee5\u4e3a\u4f8b \u56de\u7b54\uff1a \u9519\u8bef<\/p>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">94\u3001 jsonp\u539f\u7406\uff0cjquery\u662f\u600e\u4e48\u5b9e\u73b0\u7684\uff0c\u8fd9\u6837\u5b9e\u73b0\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904<\/h3>\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u539f\u7406<\/h3>\n<p style=\"margin: 1em 0px;\">\u5728\u540c\u6e90\u7b56\u7565\u4e0b;\u5728\u67d0\u4e2a\u670d\u52a1\u5668\u4e0b\u7684\u9875\u9762\u662f\u65e0\u6cd5\u83b7\u53d6\u5230\u8be5\u670d\u52a1\u5668\u4ee5\u5916\u7684\u6570\u636e\u7684;Jquery\u4e2dajax \u7684\u6838\u5fc3\u662f\u901a\u8fc7 XmlHttpRequest\u83b7\u53d6\u975e\u672c\u9875\u5185\u5bb9\uff0c\u800cjsonp\u7684\u6838\u5fc3\u5219\u662f\u52a8\u6001\u6dfb\u52a0<script>\/\/ <![CDATA[ \u6807\u7b7e\u6765\u8c03\u7528\u670d\u52a1\u5668\u63d0\u4f9b\u7684 js\u811a\u672c \u5f53\u6211\u4eec\u6b63\u5e38\u5730\u8bf7\u6c42\u4e00\u4e2aJSON\u6570\u636e\u7684\u65f6\u5019\uff0c\u670d\u52a1\u7aef\u8fd4\u56de\u7684\u662f\u4e00\u4e32 JSON\u7c7b\u578b\u7684\u6570\u636e\uff0c\u800c\u6211\u4eec\u4f7f\u7528 JSONP\u6a21\u5f0f\u6765\u8bf7\u6c42\u6570\u636e\u7684\u65f6\u5019\u670d\u52a1\u7aef\u8fd4\u56de\u7684\u662f\u4e00\u6bb5\u53ef\u6267\u884c\u7684 JavaScript\u4ee3\u7801\u3002\u56e0\u4e3ajsonp \u8de8\u57df\u7684\u539f\u7406\u5c31\u662f\u7528\u7684\u52a8\u6001\u52a0\u8f7d script\u7684src \uff0c\u6240\u4ee5\u6211\u4eec\u53ea\u80fd\u628a\u53c2\u6570\u901a\u8fc7 url\u7684\u65b9\u5f0f\u4f20\u9012, \u6240\u4ee5jsonp\u7684 type\u7c7b\u578b\u53ea\u80fd\u662fget \uff01<\/p>\n\n\n\n\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;\">$.ajax({\n    url: &#39;http:\/\/192.168.1.114\/yii\/demos\/test.php&#39;, \/\/\u4e0d\u540c\u7684\u57df\n    type: &#39;GET&#39;, \/\/ jsonp\u6a21\u5f0f\u53ea\u6709GET \u662f\u5408\u6cd5\u7684\n    data: {\n        &#39;action&#39;: &#39;aaron&#39;\n    },\n    dataType: &#39;jsonp&#39;, \/\/ \u6570\u636e\u7c7b\u578b\n    jsonp: &#39;backfunc&#39;, \/\/ \u6307\u5b9a\u56de\u8c03\u51fd\u6570\u540d\uff0c\u4e0e\u670d\u52a1\u5668\u7aef\u63a5\u6536\u7684\u4e00\u81f4\uff0c\u5e76\u56de\u4f20\u56de\u6765\n})\n\u5176\u5b9ejquery \u5185\u90e8\u4f1a\u8f6c\u5316\u6210\nhttp:\/\/192.168.1.114\/yii\/demos\/test.php?backfunc=jQuery2030038573939353227615_1402643146875&amp;action=aaron\n\u7136\u540e\u52a8\u6001\u52a0\u8f7d\n&lt;script type=&quot;text\/javascript&quot;src=&quot;http:\/\/192.168.1.114\/yii\/demos\/test.php?backfunc=&gt;\n\u7136\u540e\u540e\u7aef\u5c31\u4f1a\u6267\u884cbackfunc(\u4f20\u9012\u53c2\u6570 )\uff0c\u628a\u6570\u636e\u901a\u8fc7\u5b9e\u53c2\u7684\u5f62\u5f0f\u53d1\u9001\u51fa\u53bb\u3002\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5728jquery \u6e90\u7801\u4e2d\uff0c jsonp\u7684\u5b9e\u73b0\u65b9\u5f0f\u662f\u52a8\u6001\u6dfb\u52a0<script>\u6807\u7b7e\u6765\u8c03\u7528\u670d\u52a1\u5668\u63d0\u4f9b\u7684 js\u811a\u672c\u3002jquery \u4f1a\u5728window\u5bf9\u8c61\u4e2d\u52a0\u8f7d\u4e00\u4e2a\u5168\u5c40\u7684\u51fd\u6570\uff0c\u5f53 <script>\u4ee3\u7801\u63d2\u5165\u65f6\u51fd\u6570\u6267\u884c\uff0c\u6267\u884c\u5b8c\u6bd5\u540e\u5c31 <script>\u4f1a\u88ab\u79fb\u9664\u3002\u540c\u65f6jquery\u8fd8\u5bf9\u975e\u8de8\u57df\u7684\u8bf7\u6c42\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u5982\u679c\u8fd9\u4e2a\u8bf7\u6c42\u662f\u5728\u540c\u4e00\u4e2a\u57df\u540d\u4e0b\u90a3\u4e48\u4ed6\u5c31\u4f1a\u50cf\u6b63\u5e38\u7684 Ajax\u8bf7\u6c42\u4e00\u6837\u5de5\u4f5c\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">95\u3001 http\u534f\u8bae\u5c5e\u4e8e\u4e03\u5c42\u534f\u8bae\u4e2d\u7684\u54ea\u4e00\u5c42\uff0c\u4e0b\u4e00\u5c42\u662f\u4ec0\u4e48<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u4e03\u5c42\u7ed3\u6784\uff1a\u7269\u7406\u5c42\u3001\u6570\u636e\u94fe\u8def\u5c42\u3001\u7f51\u7edc\u5c42\u3001\u4f20\u8f93\u5c42\u3001\u4f1a\u8bdd\u5c42\u3001\u8868\u793a\u5c42\u3001\u5e94\u7528\u5c42 tcp\u5c5e\u4e8e\u4f20\u8f93\u5c42\uff1bhttp\u5c5e\u4e8e\u5e94\u7528\u5c42\u3002 \u8868\u73b0\u5c42<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">96\u3001 js\u5783\u573e\u56de\u6536\u673a\u5236\u77e5\u9053\u54ea\u4e9b\uff0cv8\u5f15\u64ce\u4f7f\u7528\u7684\u54ea\u4e00\u79cd<\/h3>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">js\u7684\u4e24\u79cd\u56de\u6536\u673a\u5236<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">1 \u6807\u8bb0\u6e05\u9664\uff08mark and sweep\uff09 2 \u5f15\u7528\u8ba1\u6570\uff08reference counting\uff09<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">javascript\u4e0eV8\u5f15\u64ce<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5783\u573e\u56de\u6536\u673a\u5236\u7684\u597d\u5904\u548c\u574f\u5904<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u597d\u5904\uff1a\u5927\u5e45\u7b80\u5316\u7a0b\u5e8f\u7684\u5185\u5b58\u7ba1\u7406\u4ee3\u7801\uff0c\u51cf\u8f7b\u7a0b\u5e8f\u733f\u8d1f\u62c5\uff0c\u5e76\u4e14\u51cf\u5c11\u56e0\u4e3a\u957f\u65f6\u95f4\u8fd0\u8f6c\u800c\u5e26\u6765\u7684\u5185\u5b58\u6cc4\u9732\u95ee\u9898\u3002<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u574f\u5904\uff1a\u81ea\u52a8\u56de\u6536\u610f\u5473\u7740\u7a0b\u5e8f\u733f\u65e0\u6cd5\u638c\u63a7\u5185\u5b58\u3002ECMAScript\u4e2d\u6ca1\u6709\u66b4\u9732\u5783\u573e\u56de\u6536\u7684\u501f\u53e3\uff0c\u6211\u4eec\u65e0\u6cd5\u5f3a\u8feb\u5176\u8fdb\u884c\u5783\u573e\u56de\u6536\uff0c\u66f4\u52a0\u65e0\u6cd5\u5e72\u9884\u5185\u5b58\u7ba1\u7406\u3002<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">V8 \u81ea\u52a8\u5783\u573e\u56de\u6536\u7b97\u6cd5 <a href='https:\/\/segmentfault.com\/a\/1190000000440270'>https:\/\/segmentfault.com\/a\/11...<\/a><\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">97\u3001 \u4f5c\u7528\u57df\u4ec0\u4e48\u65f6\u5019\u751f\u6210\u7684\uff1f<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u9875\u9762\u52a0\u8f7d--&gt;\u521b\u5efawindow\u5168\u5c40\u5bf9\u8c61\uff0c\u5e76\u751f\u6210\u5168\u5c40\u4f5c\u7528\u57df--&gt;\u7136\u540e\u751f\u6210\u6267\u884c\u4e0a\u4e0b\u6587\uff0c\u9884\u89e3\u6790\u53d8\u91cf(\u53d8\u91cf\u63d0\u5347)\uff0c\u751f\u6210\u5168\u5c40\u53d8\u91cf\u5bf9\u8c61\uff1b $scope<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">98\u3001 websocket\u957f\u8fde\u63a5\u539f\u7406\u662f\u4ec0\u4e48<\/h3>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u542b\u4e49<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">Websocket\u662f\u4e00\u4e2a\u6301\u4e45\u5316\u7684\u534f\u8bae\uff0c\u76f8\u5bf9\u4e8eHTTP\u8fd9\u79cd\u975e\u6301\u4e45\u7684\u534f\u8bae\u6765\u8bf4\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u539f\u7406<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7c7b\u4f3c\u957f\u8f6e\u5faa\u957f\u8fde\u63a5 ; \u53d1\u9001\u4e00\u6b21\u8bf7\u6c42 ; \u6e90\u6e90\u4e0d\u65ad\u7684\u5f97\u5230\u4fe1\u606f<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">28. http\u7f13\u5b58\u77e5\u9053\u54ea\u4e9b<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\"><a href='http:\/\/blog.csdn.net\/yzf913214\/article\/details\/52268651'>http:\/\/blog.csdn.net\/yzf91321...<\/a><\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">99\u3001 \u8bb2\u4e00\u4e0b\u4e8b\u4ef6\u5faa\u73af\u673a\u5236<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6267\u884c\u4e0a\u4e0b\u6587(Execution context) \u51fd\u6570\u8c03\u7528\u6808(call stack) \u961f\u5217\u6570\u636e\u7ed3\u6784(queue) Promise<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\"><a href='https:\/\/zhuanlan.zhihu.com\/p\/25407758'>https:\/\/zhuanlan.zhihu.com\/p\/...<\/a><\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">100\u3001 \u7406\u89e3web\u5b89\u5168\u5417\uff1f\u90fd\u6709\u54ea\u51e0\u79cd\uff0c\u4ecb\u7ecd\u4ee5\u53ca\u5982\u4f55\u9884\u9632<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">1.XSS\uff0c\u4e5f\u5c31\u662f\u8de8\u7ad9\u811a\u672c\u6ce8\u5165<\/p>\n\n\n\n\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;\">\u653b\u51fb\u65b9\u6cd5\uff1a\n1\\. \u624b\u52a8\u653b\u51fb:\n\u7f16\u5199\u6ce8\u5165\u811a\u672c\uff0c\u6bd4\u5982\u201d\/&gt;&lt;script&gt;alert(document.cookie());&lt;\/script&gt;&lt;!--\u7b49\uff0c\n\u624b\u52a8\u6d4b\u8bd5\u76ee\u6807\u7f51\u7ad9\u4e0a\u6709\u7684input, textarea\u7b49\u6240\u6709\u53ef\u80fd\u8f93\u5165\u6587\u672c\u4fe1\u606f\u7684\u533a\u57df\n2\\. \u81ea\u52a8\u653b\u51fb\n\u5229\u7528\u5de5\u5177\u626b\u63cf\u76ee\u6807\u7f51\u7ad9\u6240\u6709\u7684\u7f51\u9875\u5e76\u81ea\u52a8\u6d4b\u8bd5\u5199\u597d\u7684\u6ce8\u5165\u811a\u672c\uff0c\u6bd4\u5982\uff1aBurpsuite\u7b49\n\u9632\u5fa1\u65b9\u6cd5\uff1a\n1\\. \u5c06cookie\u7b49\u654f\u611f\u4fe1\u606f\u8bbe\u7f6e\u4e3ahttponly\uff0c\u7981\u6b62Javascript\u901a\u8fc7document.cookie\u83b7\u5f97\n2\\. \u5bf9\u6240\u6709\u7684\u8f93\u5165\u505a\u4e25\u683c\u7684\u6821\u9a8c\u5c24\u5176\u662f\u5728\u670d\u52a1\u5668\u7aef\uff0c\u8fc7\u6ee4\u6389\u4efb\u4f55\u4e0d\u5408\u6cd5\u7684\u8f93\u5165\uff0c\u6bd4\u5982\u624b\u673a\u53f7\u5fc5\u987b\u662f\u6570\u5b57\uff0c\u901a\u5e38\u53ef\u4ee5\u91c7\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\n3\\. \u51c0\u5316\u548c\u8fc7\u6ee4\u6389\u4e0d\u5fc5\u8981\u7684html\u6807\u7b7e\uff0c\u6bd4\u5982\uff1a&lt;iframe&gt;, alt,&lt;script&gt; \u7b49\n4\\. \u51c0\u5316\u548c\u8fc7\u6ee4\u6389\u4e0d\u5fc5\u8981\u7684Javascript\u7684\u4e8b\u4ef6\u6807\u7b7e\uff0c\u6bd4\u5982\uff1aonclick, onfocus\u7b49\n5\\. \u8f6c\u4e49\u5355\u5f15\u53f7\uff0c\u53cc\u5f15\u53f7\uff0c\u5c16\u62ec\u53f7\u7b49\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u4ee5\u91c7\u7528htmlencode\u7f16\u7801 \u6216\u8005\u8fc7\u6ee4\u6389\u8fd9\u4e9b\u7279\u6b8a\u5b57\u7b26\n6\\. \u8bbe\u7f6e\u6d4f\u89c8\u5668\u7684\u5b89\u5168\u8bbe\u7f6e\u6765\u9632\u8303\u5178\u578b\u7684XSS\u6ce8\u5165\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">2.SQL\u6ce8\u5165<\/p>\n\n\n\n\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;\">\u653b\u51fb\u65b9\u6cd5\uff1a\n\u7f16\u5199\u6076\u610f\u5b57\u7b26\u4e32\uff0c\u6bd4\u5982\u2018 or  1=1--\u7b49\uff0c\n\u624b\u52a8\u6d4b\u8bd5\u76ee\u6807\u7f51\u7ad9\u4e0a\u6240\u6709\u6d89\u53ca\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u5730\u65b9\n\u9632\u5fa1\u65b9\u6cd5\uff1a\n1\\. \u7981\u6b62\u76ee\u6807\u7f51\u7ad9\u5229\u7528\u52a8\u6001\u62fc\u63a5\u5b57\u7b26\u4e32\u7684\u65b9\u5f0f\u8bbf\u95ee\u6570\u636e\u5e93\n2\\. \u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u6570\u636e\u5e93\u629b\u51fa\u7684\u9519\u8bef\u4fe1\u606f\n3\\. \u5bf9\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u8d4b\u4e88\u4e25\u683c\u7684\u6743\u9650\u63a7\u5236\n4\\. \u51c0\u5316\u548c\u8fc7\u6ee4\u6389\u4e0d\u5fc5\u8981\u7684SQL\u4fdd\u7559\u5b57\uff0c\u6bd4\u5982\uff1awhere, or, exec \u7b49\n5\\. \u8f6c\u4e49\u5355\u5f15\u53f7\uff0c\u4e0a\u5f15\u53f7\uff0c\u5c16\u62ec\u53f7\u7b49\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u4ee5\u91c7\u7528htmlencode\u7f16\u7801 \u6216\u8005\u8fc7\u6ee4\u6389\u8fd9\u4e9b\u7279\u6b8a\u5b57\u7b26\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">3.CSRF\uff0c\u4e5f\u5c31\u662f\u8de8\u7ad9\u8bf7\u6c42\u4f2a\u9020<\/p>\n\n\n\n\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;\">\u5c31\u662f\u653b\u51fb\u8005\u5192\u7528\u7528\u6237\u7684\u540d\u4e49\uff0c\u5411\u76ee\u6807\u7ad9\u70b9\u53d1\u9001\u8bf7\u6c42\n\u9632\u8303\u65b9\u6cd5\uff1a\n1\\. \u5728\u5ba2\u6237\u7aef\u8fdb\u884ccookie\u7684hashing\uff0c\u5e76\u5728\u670d\u52a1\u7aef\u8fdb\u884chash\u8ba4\u8bc1\n2\\. \u63d0\u4ea4\u8bf7\u6c42\u662f\u9700\u8981\u586b\u5199\u9a8c\u8bc1\u7801\n3\\. \u4f7f\u7528One-Time Tokens\u4e3a\u4e0d\u540c\u7684\u8868\u5355\u521b\u5efa\u4e0d\u540c\u7684\u4f2a\u968f\u673a\u503c  \n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">101\u3001 sessionStorage\u548clocalstorage\u80fd\u8de8\u57df\u62ff\u5230\u5417\uff1f\u6bd4\u5982\u6211\u5728<a href='http:\/\/www.baidu.com'>www.baidu.com<\/a>\u8bbe\u7f6e\u7684\u503c\u80fd\u5728<a href='http:\/\/m.baidu.com'>m.baidu.com<\/a>\u80fd\u62ff\u5230\u5417\uff1f\u4e3a\u4ec0\u4e48<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">localStorage\u4f1a\u8ddfcookie\u4e00\u6837\u53d7\u5230\u8de8\u57df\u7684\u9650\u5236\uff0c\u4f1a\u88abdocument.domain\u5f71\u54cd<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">102\u3001 localstorage\u4e0d\u80fd\u624b\u52a8\u5220\u9664\u7684\u65f6\u5019\uff0c\u4ec0\u4e48\u65f6\u5019\u8fc7\u671f<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u9664\u975e\u88ab\u6e05\u9664\uff0c\u5426\u5219\u6c38\u4e45\u4fdd\u5b58 clear()\u53ef\u6e05\u695a sessionStorage \u4ec5\u5728\u5f53\u524d\u4f1a\u8bdd\u4e0b\u6709\u6548\uff0c\u5173\u95ed\u9875\u9762\u6216\u6d4f\u89c8\u5668\u540e\u88ab\u6e05\u9664<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">103\u3001cookie\u53ef\u4ee5\u8bbe\u7f6e\u4ec0\u4e48\u57df\uff1f\u53ef\u4ee5\u8bbe\u7f6e.com\u5417<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6edomin\u6765\u5b9e\u73b0<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">104\u3001\u767b\u5f55\u72b6\u6001\u7684\u4fdd\u5b58\u4f60\u8ba4\u4e3a\u53ef\u4ee5\u4fdd\u5b58\u5728sessionstorage\u6216\u8005localstorage\u6216\u8005cookie\u6216\u8005\u4f60\u77e5\u9053\u7684\u54ea\u79cd\u65b9\u5f0f\uff0c\u5b58\u5728\u4e86\u54ea\u91cc\uff1f\uff1f\u4e3a\u4ec0\u4e48\u4fdd\u5b58\u5728\u90a3\u91cc<\/h3>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">105\u3001 flux -&gt; redux -&gt; mobx \u53d8\u5316\u7684\u672c\u8d28\u662f\u4ec0\u4e48<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5b58\u50a8\u7ed3\u6784 \u5c06\u5bf9\u8c61\u52a0\u5de5\u53ef\u89c2\u5bdf \u51fd\u6570\u5f0f vs \u9762\u5411\u5bf9\u8c61 <a href='https:\/\/zhuanlan.zhihu.com\/p\/25585910?refer=purerender'>https:\/\/zhuanlan.zhihu.com\/p\/...<\/a><\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">106\u3001 \u6309\u9700\u52a0\u8f7d\u8def\u7531\u600e\u4e48\u52a0\u8f7d\u5bf9\u5e94\u7684chunk\u6587\u4ef6\u7684\uff1f\u6362\u53e5\u8bdd\u8bf4\u6d4f\u89c8\u5668\u600e\u4e48\u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u52a0\u8f7d\u8fd9\u4e2achunk\uff0c\u4ee5\u53cawebpack\u662f\u600e\u4e48\u8bc6\u522b\u90a3\u4e2a\u591a\u4e2a\u7ecf\u8fc7hash\u8fc7\u7684chunk\u6587\u4ef6<\/h3>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">107\u3001get\u548cpost\u6709\u4ec0\u4e48\u533a\u522b\uff1fget\u53ef\u4ee5\u901a\u8fc7body\u4f20\u9012\u6570\u636e\u5417<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u628a\u6570\u636e\u653e\u5230 body \u91cc\u9762\uff0c\u5fc5\u987b\u7528 POST \u65b9\u5f0f\u53d6\uff0c\u8fd9\u662f HTTP \u534f\u8bae\u9650\u5236\u7684\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">108\u3001\u53f3\u8fb9\u5bbd\u5ea6\u56fa\u5b9a\uff0c\u5de6\u8fb9\u81ea\u9002\u5e94<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e00\u79cd\uff1a<\/p>\n\n\n\n\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;\">&lt;style&gt;\nbody{\n    display: flex;\n}\n.left{\n    background-color: rebeccapurple;\n    height: 200px;\n    flex: 1;\n}\n.right{\n    background-color: red;\n    height: 200px;\n    width: 100px;\n}\n&lt;\/style&gt;\n&lt;body&gt;\n    &lt;div class=&quot;left&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;right&quot;&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e8c\u79cd<\/p>\n\n\n\n\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;\">&lt;style&gt;\n    div {\n        height: 200px;\n    }\n    .left {\n        float: right;\n        width: 200px;\n        background-color: rebeccapurple;\n    }\n    .right {\n        margin-right: 200px;\n        background-color: red;\n    }\n&lt;\/style&gt;\n&lt;body&gt;\n    &lt;div class=&quot;left&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;right&quot;&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">109\u3001\u6c34\u5e73\u5782\u76f4\u5c45\u4e2d<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e00\u79cd<\/p>\n\n\n\n\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;\">#container{\n    position:relative;\n}\n\n#center{\n    width:100px;\n    height:100px;\n    position:absolute;\n    top:50%;\n    left:50%;\n    transform: translate(-50%,-50%);\n}\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e8c\u79cd<\/p>\n\n\n\n\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;\">#container{\n    position:relative;\n}\n\n#center{\n    width:100px;\n    height:100px;\n    position:absolute;\n    top:50%;\n    left:50%;\n    margin:-50px 0 0 -50px;\n}\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e09\u79cd<\/p>\n\n\n\n\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;\">#container{\n    position:relative;\n}\n\n#center{\n    position:absolute;\n    margin:auto;\n    top:0;\n    bottom:0;\n    left:0;\n    right:0;\n}\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7b2c\u56db\u79cd flex<\/p>\n\n\n\n\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;\">#container{\n    display:flex;\n    justify-content:center;\n    align-items: center;\n}\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">109\u3001.\u56db\u79cd\u5b9a\u4f4d\u7684\u533a\u522b<\/h3>\n\n\n\n\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;\">static<\/code> \u662f\u9ed8\u8ba4\u503c <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;\">relative<\/code> \u76f8\u5bf9\u5b9a\u4f4d \u76f8\u5bf9\u4e8e\u81ea\u8eab\u539f\u6709\u4f4d\u7f6e\u8fdb\u884c\u504f\u79fb\uff0c\u4ecd\u5904\u4e8e\u6807\u51c6\u6587\u6863\u6d41\u4e2d <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;\">absolute<\/code> \u7edd\u5bf9\u5b9a\u4f4d \u76f8\u5bf9\u4e8e\u6700\u8fd1\u7684\u5df2\u5b9a\u4f4d\u7684\u7956\u5148\u5143\u7d20, \u6709\u5df2\u5b9a\u4f4d(\u6307<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;\">position<\/code>\u4e0d\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;\">static<\/code>\u7684\u5143\u7d20)\u7956\u5148\u5143\u7d20, \u4ee5\u6700\u8fd1\u7684\u7956\u5148\u5143\u7d20\u4e3a\u53c2\u8003\u6807\u51c6\u3002\u5982\u679c\u65e0\u5df2\u5b9a\u4f4d\u7956\u5148\u5143\u7d20, \u4ee5<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;\">body<\/code>\u5143\u7d20\u4e3a\u504f\u79fb\u53c2\u7167\u57fa\u51c6, \u5b8c\u5168\u8131\u79bb\u4e86\u6807\u51c6\u6587\u6863\u6d41\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;\">fixed<\/code> \u56fa\u5b9a\u5b9a\u4f4d\u7684\u5143\u7d20\u4f1a\u76f8\u5bf9\u4e8e\u89c6\u7a97\u6765\u5b9a\u4f4d,\u8fd9\u610f\u5473\u7740\u5373\u4fbf\u9875\u9762\u6eda\u52a8\uff0c\u5b83\u8fd8\u662f\u4f1a\u505c\u7559\u5728\u76f8\u540c\u7684\u4f4d\u7f6e\u3002\u4e00\u4e2a\u56fa\u5b9a\u5b9a\u4f4d\u5143\u7d20\u4e0d\u4f1a\u4fdd\u7559\u5b83\u539f\u672c\u5728\u9875\u9762\u5e94\u6709\u7684\u7a7a\u9699\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">110\u3001\u5c01\u88c5\u4e00\u4e2a\u51fd\u6570\uff0c\u53c2\u6570\u662f\u5b9a\u65f6\u5668\u7684\u65f6\u95f4\uff0c.then\u6267\u884c\u56de\u8c03\u51fd\u6570\u3002<\/h3>\n\n\n\n\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 sleep (time) {\n  return new Promise((resolve) =&gt; setTimeout(resolve, time));\n}\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">111\u3001\u4e00\u884c\u4ee3\u7801\u5b9e\u73b0\u6570\u7ec4\u53bb\u91cd\uff1f<\/h3>\n\n\n\n\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;\">[...new Set([1,2,3,1,&#39;a&#39;,1,&#39;a&#39;])]\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">112\u3001\u4f7f\u7528addEventListener\u70b9\u51fbli\u5f39\u51fa\u5185\u5bb9\uff0c\u5e76\u4e14\u52a8\u6001\u6dfb\u52a0li\u4e4b\u540e\u6709\u6548<\/h3>\n\n\n\n\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;\">&lt;ul&gt;\n    &lt;li&gt;1&lt;\/li&gt;\n    &lt;li&gt;2&lt;\/li&gt;\n    &lt;li&gt;3&lt;\/li&gt;\n    &lt;li&gt;4&lt;\/li&gt;\n&lt;\/ul&gt;\nvar ulNode = document.getElementById(&quot;ul&quot;);\n    ulNode.addEventListener(&#39;click&#39;, function (e) {\n        if (e.target &amp;&amp; e.target.nodeName.toUpperCase() == &quot;LI&quot;) {\n            alert(e.target.innerHTML);\n        }\n    }, false);\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">113\u3001\u600e\u4e48\u5224\u65ad\u4e24\u4e2a\u5bf9\u8c61\u76f8\u7b49<\/h3>\n\n\n\n\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;\">JSON.stringify(obj)==JSON.stringify(obj);\/\/true\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">114\u3001Vue router \u9664\u4e86 router-link \u600e\u4e48\u5b9e\u73b0\u8df3\u8f6c?<\/h3>\n\n\n\n\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;\">router.go(1)\nrouter.push(&#39;\/&#39;)\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">115\u3001Vue router \u8df3\u8f6c\u548c location.href \u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3>\n\n\n\n\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;\">router<\/code> \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;\">hash<\/code> \u6539\u53d8 <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;\">location.href<\/code> \u662f\u9875\u9762\u8df3\u8f6c\uff0c\u5237\u65b0\u9875\u9762<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">116\u3001\u91cd\u6392\u548c\u91cd\u7ed8<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u90e8\u5206\u6e32\u67d3\u6811\uff08\u6216\u8005\u6574\u4e2a\u6e32\u67d3\u6811\uff09\u9700\u8981\u91cd\u65b0\u5206\u6790\u5e76\u4e14\u8282\u70b9\u5c3a\u5bf8\u9700\u8981\u91cd\u65b0\u8ba1\u7b97\u3002\u8fd9\u88ab\u79f0\u4e3a\u91cd\u6392\u3002\u6ce8\u610f\u8fd9\u91cc\u81f3\u5c11\u4f1a\u6709\u4e00\u6b21\u91cd\u6392-\u521d\u59cb\u5316\u9875\u9762\u5e03\u5c40\u3002 \u7531\u4e8e\u8282\u70b9\u7684\u51e0\u4f55\u5c5e\u6027\u53d1\u751f\u6539\u53d8\u6216\u8005\u7531\u4e8e\u6837\u5f0f\u53d1\u751f\u6539\u53d8\uff0c\u4f8b\u5982\u6539\u53d8\u5143\u7d20\u80cc\u666f\u8272\u65f6\uff0c\u5c4f\u5e55\u4e0a\u7684\u90e8\u5206\u5185\u5bb9\u9700\u8981\u66f4\u65b0\u3002\u8fd9\u6837\u7684\u66f4\u65b0\u88ab\u79f0\u4e3a\u91cd\u7ed8\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">117\u3001\u4ec0\u4e48\u60c5\u51b5\u4f1a\u89e6\u53d1\u91cd\u6392\u548c\u91cd\u7ed8<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6dfb\u52a0\u3001\u5220\u9664\u3001\u66f4\u65b0 DOM \u8282\u70b9 \u901a\u8fc7 display: none \u9690\u85cf\u4e00\u4e2a DOM \u8282\u70b9-\u89e6\u53d1\u91cd\u6392\u548c\u91cd\u7ed8 \u901a\u8fc7 visibility: hidden \u9690\u85cf\u4e00\u4e2a DOM \u8282\u70b9-\u53ea\u89e6\u53d1\u91cd\u7ed8\uff0c\u56e0\u4e3a\u6ca1\u6709\u51e0\u4f55\u53d8\u5316 \u79fb\u52a8\u6216\u8005\u7ed9\u9875\u9762\u4e2d\u7684 DOM \u8282\u70b9\u6dfb\u52a0\u52a8\u753b \u6dfb\u52a0\u4e00\u4e2a\u6837\u5f0f\u8868\uff0c\u8c03\u6574\u6837\u5f0f\u5c5e\u6027 \u7528\u6237\u884c\u4e3a\uff0c\u4f8b\u5982\u8c03\u6574\u7a97\u53e3\u5927\u5c0f\uff0c\u6539\u53d8\u5b57\u53f7\uff0c\u6216\u8005\u6eda\u52a8\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">118\u3001js bind \u5b9e\u73b0\u673a\u5236\uff1f\u624b\u5199\u4e00\u4e2a bind \u65b9\u6cd5\uff1f<\/h3>\n\n\n\n\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 bind(fn, context){\n  return function (){\n     return fn.apply(context, arguments);\n  }\n}\n\/\/ \u67ef\u7406\u5316\u51fd\u6570\u601d\u60f3   \u611f\u8c22pursuitTom\u7684\u63d0\u51fa\nFunction.prototype.bind = function (context) {\n    var args = Array.prototype.slice.call(arguments, 1);\n    var _this = this;\n    return function () {\n        var thisArgs = [].slice.call(arguments);\n        return _this.apply(context, args.concat(thisArgs))\n    };\n}\n\/\/ ES6\u5199\u6cd5 \u611f\u8c22waterc\u7684\u63d0\u51fa\nFunction.prototype.bind = function(context, ...res) {\n    let self = this\n    return function(...arg) {\n        return self.apply(context, [...res,...arg])\n    }\n}\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">119\u3001\u591a\u4e2a\u51fd\u6570<\/h3>\n\n\n\n\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 a = (function(){return &#39;1&#39;;}, function(){return 1;})();\nconsole.log(typeof a); \/\/number\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">120\u3001proto\u3001prototype\u3001Object.getPrototypeOf()<\/h3>\n\n\n\n\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;\">__proto__\u662f\u6307\u5185\u90e8\u539f\u578b\uff0c\u548cObject.getPrototypeOf()\u7ed3\u679c\u7b49\u4ef7\nfunction f(){}\nf.__proto__ === Object.getPrototypeOf(f); \/\/true\nf.prototype === Object.getPrototypeOf(f); \/\/false\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">121\u3001\u6d4f\u89c8\u8bb0\u5f55\u524d\u540e\u8df3\u8f6c\uff08\u5c1a\u672a\u8bd5\u9a8c\uff09<\/h3>\n\n\n\n\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;\">&lt;a href=&quot;javascript:history.go(-1)&quot;&gt;backward&lt;\/a&gt;\n&lt;a href=&quot;javascript:history.go(1)&quot;&gt;forward&lt;\/a&gt;\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">122\u3001setTimeout \u548c setInterval \u7ec6\u8c08<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5e38\u95ee\u7684\u70b9\uff0c\u524d\u8005\u662f\u5728\u4e00\u5b9a\u65f6\u95f4\u8fc7\u540e\u5c06\u51fd\u6570\u6dfb\u52a0\u81f3\u6267\u884c\u961f\u5217\uff0c\u6267\u884c\u65f6\u95f4=\u5ef6\u8fdf\u65f6\u95f4+\u4e4b\u524d\u51fd\u6570\u4ee3\u7801\u6267\u884c\u65f6\u95f4+\u6267\u884c\u51fd\u6570\u65f6\u95f4\u3002 \u540e\u8005\u662f\u4e0d\u7ba1\u524d\u4e00\u6b21\u662f\u5426\u6267\u884c\u5b8c\u6bd5\uff0c\u6bcf\u9694\u4e00\u5b9a\u65f6\u95f4\u91cd\u590d\u6267\u884c\uff0c\u7528\u4e8e\u7cbe\u51c6\u6267\u884c\u4e92\u76f8\u6ca1\u6709\u5f71\u54cd\u7684\u91cd\u590d\u64cd\u4f5c\u3002 \u5982\u679c\u9700\u8981\u63a7\u5236\u524d\u540e\u6267\u884c\u987a\u5e8f\uff0c\u6700\u597d\u4f7f\u7528setTimeout\u6a21\u62dfsetInterval<\/p>\n\n\n\n\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 time = 400, times = 0, max = 10;\nfunction func(){\n  times++;\n  if(times &lt; max){\n    \/\/code here\n    setTimeout(func, time);\n  } else {\n    console.log(&quot;finished&quot;);\n  }\n}\nsetTimeout(func, time);\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">123\u3001\u5224\u65ad\u591a\u56fe\u7247\u52a0\u8f7d\u5b8c\u6bd5<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6ce8\uff1a\u7528jQueryObject.ready()\u53ea\u80fd\u5224\u65addom\u7ed3\u6784\u52a0\u8f7d\u5b8c\u6bd5 \u597d\u50cf\u63cf\u8ff0\u7684\u4e0d\u662f\u5f88\u6e05\u695a\uff0c\u8fd9\u91cc\u5199\u4e00\u4e0b\u4ee3\u7801\u3002 \u65b9\u6cd51\uff1a<\/p>\n\n\n\n\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 counter = 0;\nvar queryInterval = 30; \/\/ms\nvar pics = document.getElementsByClassName(&quot;pics&quot;);\n\nfunction singleQuery(i){\n  if(pics[i].complete){\n    counter++;\n    console.log(i + &quot; is loaded&quot;);\n  } else {\n    setTimeout(singleQuery, queryInterval, i);\n  }\n}\n\nfunction allQuery(callback){\n  if(counter &lt; pics.length){\n    console.log(&quot;current number of loaded pics: &quot; + counter);\n    setTimeout(allQuery, queryInterval, callback);\n  } else {\n    console.log(&quot;All pics are loaded.&quot;);\n    callback();\n  }\n}\n\nfor(var i = 0; i &lt; pics.length; i++){\n  setTimeout(singleQuery, queryInterval, i);\n}\n\nsetTimeout(allQuery, queryInterval, callback);\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u4e3b\u8981\u4e5f\u662f\u91c7\u7528setTimeout\u6a21\u62df\u8f6e\u8be2\uff0c\u5224\u65ad\u65b9\u5f0f\u662fimg\u6807\u7b7edom\u7684complete\u5c5e\u6027\uff08\u5e03\u5c14\u503c\uff09\uff0c\u7f3a\u70b9\u662f\u5b9a\u65f6\u5668\u592a\u591a\u3002<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u65b9\u6cd52\uff1a<\/p>\n\n\n\n\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 counter = 0, queryInterval = 50;\nvar pics = document.getElementsByClassName(&quot;pics&quot;);\nfor(var i = 0; i &lt; pics.length; i++){\n  pics[i].onload = function(){\n    counter++;\n    console.log(this.id + &quot; is loaded&quot;);\n  }\n}\n\nfunction queryPictures(callback){\n  if(counter &lt; pics.length){\n    console.log(&quot;current number of loaded pics: &quot; + counter);\n    setTimeout(queryPictures, queryInterval, callback);\n  } else {\n    console.log(&quot;All pics are loaded&quot;);\n    callback();\n  }\n}\n\nsetTimeout(queryPictures, queryInterval, callback);\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5229\u7528onload\u7ed1\u5b9a\u56fe\u7247\u52a0\u8f7d\u6210\u529f\u540e\u7684\u56de\u8c03\uff0c\u901a\u8fc7\u8ba1\u6570\u5668\u5224\u65ad\u662f\u5426\u52a0\u8f7d\u5b8c\u6bd5\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">124\u3001CSS margin\u91cd\u53e0\u95ee\u9898<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5757\u5143\u7d20\u5728\u5782\u76f4\u65b9\u5411\u4e0a\u7684margin\u662f\u5f88\u5947\u602a\u7684\uff0c\u4f1a\u6709\u91cd\u53e0\u73b0\u8c61\u3002 \u5982\u679cdisplay\u90fd\u662fblock\uff0c\u6709\u4e09\u79cd\u60c5\u51b5\uff1a \u5916\u95f4\u8ddd\u5747\u4e3a\u6b63\u6570\uff0c\u7ad6\u76f4\u65b9\u5411\u4e0a\u4f1a\u9009\u62e9\u6700\u5927\u7684\u5916\u8fb9\u8ddd\u4f5c\u4e3a\u95f4\u9694 \u4e00\u6b63\u4e00\u8d1f\uff0c\u95f4\u8ddd = \u6b63 - |\u8d1f| \u4e24\u4e2a\u8d1f\uff0c\u95f4\u8ddd = 0 - \u7edd\u5bf9\u503c\u6700\u5927\u7684\u90a3\u4e2a \u8bbe\u7f6edisplay: inline-block\u7684\u76d2\u5b50\u4e0d\u4f1a\u6709margin\u91cd\u53e0\uff0cposition: absolute\u7684\u4e5f\u4e0d\u4f1a\u51fa\u73b0\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">125\u3001CSS\u9009\u62e9\u5668\u4f18\u5148\u7ea7 &amp;&amp; CSS\u9009\u62e9\u5668\u6548\u7387<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">ID &gt; \u7c7b &gt; \u6807\u7b7e &gt; \u76f8\u90bb &gt; \u5b50\u9009\u62e9\u5668 &gt; \u540e\u4ee3\u9009\u62e9\u5668 &gt; * &gt; \u5c5e\u6027 &gt; \u4f2a\u7c7b<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">object.propertyIsEnumerable(xxx)<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5224\u65ad\u5bf9\u8c61\u4e2d\u662f\u5426\u6709xxx\u5c5e\u6027\uff0c\u5e76\u4e14\u80fd\u901a\u8fc7for in\u679a\u4e3e\uff0c\u5982Array\u5bf9\u8c61\u7684length\u662f\u4e0d\u53ef\u679a\u4e3e\u7684<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">126\u3001\u5224\u65ad\u6570\u7ec4<\/h3>\n\n\n\n\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 isArray(arr){\n    return Object.prototype.toString.call(arr) === &#39;[Object Array]&#39;;\n}\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">127\u3001git fetch &amp;&amp; git pull<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">git pull\u81ea\u52a8\u5b8c\u6210\u4e86fetch\u6700\u65b0\u8fdc\u7a0b\u7248\u672c\uff0c\u5e76\u4e14\u548c\u672c\u5730\u8fdb\u884cmerge git fetch\u83b7\u5f97\u8fdc\u7a0b\u5206\u652f\uff0c\u8981\u7ee7\u7eed\u624b\u52a8merge\u5408\u5e76<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">128\u3001WebSocket<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">HTML5\u5e26\u6765\u7684\u65b0\u534f\u8bae\uff0c\u901a\u8fc7\u7c7b\u4f3cHTTP\u7684\u8bf7\u6c42\u5efa\u7acb\u8fde\u63a5\u3002\u4e3b\u8981\u76ee\u7684\u662f\u53ef\u4ee5\u83b7\u53d6\u670d\u52a1\u7aef\u7684\u63a8\u9001\u3002 \u539f\u6765\u7684\u65b9\u5f0f\u53ef\u80fd\u662f\u4f7f\u7528long poll\uff08\u5373\u4e0d\u4e2d\u65ad\u8fde\u63a5\u4e00\u76f4\u7b49\u5f85\u6570\u636e\uff09\uff0c\u6216\u8005\u662fajax\u8f6e\u8be2\u7684\u65b9\u5f0f\uff08\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u53d1\u9001\u8bf7\u6c42\uff0c\u5efa\u7acb\u8fde\u63a5\uff0c\u8be2\u95ee\u662f\u5426\u6709\u65b0\u7684\u6570\u636e\uff09\u3002\u8fd9\u4e24\u79cd\u65b9\u5f0f\u7684\u7f3a\u70b9\u5728\u4e8elong poll\u7684\u963b\u585e\uff0c\u4ee5\u53caajax\u8f6e\u8be2\u7684\u5197\u4f59\u8fde\u63a5\u3002 WebSocket\u7684\u8bbe\u8ba1\u601d\u60f3\u6709\u70b9\u7c7b\u4f3c\u4e8e\u56de\u8c03\uff0c\u5728\u53d1\u9001\u8bf7\u6c42\u5347\u7ea7\u670d\u52a1\u7aef\u7684\u534f\u8bae\u5e76\u6536\u5230\u786e\u8ba4\u4fe1\u606f\u540e\uff0c\u670d\u52a1\u7aef\u4e00\u6709\u65b0\u7684\u4fe1\u606f\/\u6570\u636e\u5c31\u4f1a\u4e3b\u52a8\u63a8\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u81f3\u4e8e\u8981\u4e00\u6b21HTTP\u63e1\u624b\u4fbf\u53ef\u4ee5\u5efa\u7acb\u6301\u4e45\u8fde\u63a5<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">129\u3001\u8de8\u57df\u76f8\u5173<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u53ea\u8981\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u6709\u4e0d\u540c\uff0c\u5219\u89c6\u4e3a\u4e0d\u540c\u7684\u57df\u3002\uff08\u57df\u540d\u548c\u57df\u540d\u5bf9\u5e94\u7684IP\u4e5f\u662f\u8de8\u57df\uff09<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">1.CORS: Cross-Origin Resource Sharing<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u57fa\u4e8e\u670d\u52a1\u5668\u652f\u6301\u7684\u8de8\u57df\uff0c\u670d\u52a1\u5668\u8bbe\u7f6eAccess-Control-Allow-Origin\u54cd\u5e94\u5934\uff0c\u6d4f\u89c8\u5668\u53ef\u5141\u8bb8\u8de8\u57df<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">2.\u8bbe\u7f6edomain<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u80fd\u4ece\u5b50\u57df\u8bbe\u5230\u4e3b\u57df\uff0c\u5982a.b.c.com\u2014&gt;b.c.com\u2014&gt;c.com \u5177\u4f53\u60c5\u51b5\uff1a\u5728\u9875\u9762\u4e2d\u7528iframe\u6253\u5f00\u4e86\u53e6\u4e00\u4e2a\u9875\u9762\uff08\u524d\u63d0\uff1a\u4e24\u4e2a\u9875\u9762\u4e3b\u57df\u662f\u76f8\u540c\u7684\uff09 \u5229\u7528frameElement.contentWindow.document.domain\u8bbe\u7f6eframe\u5b50\u9875\u9762\u7684\u4e3b\u57df\uff0cdocument.domain\u8bbe\u7f6e\u4e3b\u9875\u9762\u7684\u4e3b\u57df\uff0c\u4e4b\u540e\u5c31\u80fd\u4e92\u76f8\u83b7\u53d6dom\u4e2d\u7684\u6570\u636e\u3002 \u7f3a\u70b9\u662f\u53ea\u80fd\u7528\u4e8e\u4e0d\u540c\u5b50\u57df\u95f4\u7684\u4ea4\u4e92\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">3.\u4f8b\u5982\u62e5\u6709src\u5c5e\u6027\u7684img\u6807\u7b7e\uff0c\u6bcf\u6b21\u6539\u53d8src\u5c5e\u6027\uff0c\u90fd\u4f1a\u53d1\u8d77http\u8bf7\u6c42\u3002<\/h3>\n\n\n\n\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 img = new Image();\nimg.onload = function(){\n  \/\/code here\n};\nimg.onerror = function(){\n  \/\/code here\n};\nimg.src=&quot;http:\/\/server.com\/data?query=3&quot;;\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u7f3a\u70b9\u662f\u53ea\u80fd\u4f7f\u7528GET\u8bf7\u6c42\uff0c\u4e0d\u80fd\u83b7\u53d6\u6570\u636e\uff0c\u4e00\u822c\u7528\u4e8e\u63d0\u4ea4\u7edf\u8ba1\u4fe1\u606f\u4ec0\u4e48\u7684\u3002 script\u3001link\u3001iframe\u53ea\u6709\u5728\u6dfb\u52a0\u5230DOM\u4e2d\u624d\u4f1a\u53d1\u8d77\u8bf7\u6c42<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">4.HTML5 postMessage<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u652f\u6301IE8+\u548c\u4e3b\u6d41\u6d4f\u89c8\u5668\uff0c\u5199\u6cd5\u4e5f\u7b80\u5355..<\/p>\n\n\n\n\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;\">\/\/source: http:\/\/test.org:4000\n\/\/get the window object of target origin\nvar win = window.open(&quot;http:\/\/target.com&quot;);\n\/\/or this, when a frame is used\nvar win = document.getElementById(&quot;targetId&quot;).contentWindow;\nwin.postMessage(&quot;data here&quot;, &quot;http:\/\/target.com\/rest&quot;);\n\n\/\/target: http:\/\/target.com\/tiny\nfunction handleMessage(event){\n  if(event.orgin!=&quot;http:\/\/test.org:4000&quot;)\n    return;\n  var data = event.data;\n  \/\/code here\n\n  \/\/event.source is window.opener\n  event.source.postMessage(&quot;response data here&quot;, event.origin);\n}\nwindow.addEventListener(&quot;message&quot;, handleMessage, false);\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">5.window.name<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5373\u4f7f\u5728\u9875\u9762\u6253\u5f00\u591a\u5c42iframe\u540e\uff0c\u6bcf\u4e2aiframe\u4e2dwindow.name \u5c5e\u6027\u503c\u90fd\u662f\u76f8\u540c\u7684\uff0c\u4ee5\u6b64\u7528\u4f5c\u6570\u636e\u4f20\u8f93\u7684\u5de5\u5177\u3002 \u4f46\u7531\u4e8e\u8de8\u57df\u7684\u9650\u5236\uff0c\u662f\u65e0\u6cd5\u83b7\u53d6\u53e6\u4e00\u4e2aframe\u4e2d\u7684window.name\u6570\u636e\uff0c\u6240\u4ee5\u8981\u4f7f\u7528\u4e00\u4e2a\u540c\u57df\u7684\u4ee3\u7406(proxy.html)\uff1a<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">6. jsonp<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u76ee\u524d\u4e3b\u6d41\u8de8\u57df\u65b9\u6cd5 \u8c03\u7528\u5176\u4ed6\u57df\u7684\u811a\u672c\u83b7\u53d6\u6570\u636e\uff0c\u524d\u63d0\u662f\u53e6\u4e00\u4e2a\u57df\u80fd\u77e5\u9053\u56de\u8c03\u51fd\u6570\u540d\uff0c\u8fd9\u4e2a\u53ef\u4ee5\u901a\u8fc7\u8bf7\u6c42\u53d1\u9001\u7ed9\u76ee\u6807\u57df\u3002 \u76f4\u63a5\u5199jQuery\u5c01\u7684jsonp<\/p>\n\n\n\n\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;\">$.getJSON(&quot;http:\/\/target.com\/data?callback=callbackFunctionName&quot;, function(data){});\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">$.getJSON\u4f1a\u628a\u83b7\u53d6\u7684responseText\u8f6c\u4e3ajson\uff0c\u5982\u679curl\u4e2d\u6709callback\u53c2\u6570\uff0c\u6570\u636e\u4f1a\u4ee5script\u6807\u7b7e\u5f62\u5f0f\u83b7\u53d6\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">130\u3001\u95ed\u5305\u76f8\u5173<\/h3>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4ec0\u4e48\u662f\u95ed\u5305<\/h3>\n\n\n\n\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\n\u95ed\u5305\u662f\u6307\u6709\u6743\u8bbf\u95ee\u53e6\u4e00\u4e2a\u51fd\u6570\u4f5c\u7528\u57df\u4e2d\u53d8\u91cf\u7684\u51fd\u6570\n\n<\/blockquote>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u600e\u4e48\u521b\u5efa\u95ed\u5305<\/h3>\n\n\n\n\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\n\u5728\u51fd\u6570\u5185\u90e8\u5d4c\u5957\u4f7f\u7528\u51fd\u6570\n\n<\/blockquote>\n\n\n\n\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 fn() {\n           for (var i = 0; i &lt; 2; i++) {\n               (function () {\n                   var variate = i;\n                   setTimeout(function () {\n                       console.log(&quot;setTimeout\u6267\u884c\u540e:&quot;+variate);\n                   }, 1000);\n               })();\/\/\u95ed\u5305,\u7acb\u5373\u6267\u884c\u51fd\u6570,\u533f\u540d\u51fd\u6570\n\n           }\n          console.log(i);\/\/2\n          console.log(variate);\/\/variate is not defined\n       }\n       fn();\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u4e3a\u4ec0\u4e48\u7528\u95ed\u5305<\/h3>\n\n\n\n\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n\n\t\n\n\t\n\n<li>\n\n<section>\u56e0\u4e3a\u5728\u95ed\u5305\u5185\u90e8\u4fdd\u6301\u4e86\u5bf9\u5916\u90e8\u6d3b\u52a8\u5bf9\u8c61\u7684\u8bbf\u95ee,\u4f46\u5916\u90e8\u7684\u53d8\u91cf\u5374\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee\u5185\u90e8,\u907f\u514d\u4e86\u5168\u5c40\u6c61\u67d3;<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u53ef\u4ee5\u5f53\u505a\u79c1\u6709\u6210\u5458,\u5f25\u8865\u4e86\u56e0js\u8bed\u6cd5\u5e26\u6765\u7684\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u4e0d\u8db3;<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u53ef\u4ee5\u957f\u4e45\u7684\u5728\u5185\u5b58\u4e2d\u4fdd\u5b58\u4e00\u4e2a\u81ea\u5df1\u60f3\u8981\u4fdd\u5b58\u7684\u53d8\u91cf.<\/section>\n\n<\/li>\n\n\n\n<\/ul>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">\u95ed\u5305\u7684\u7f3a\u70b9<\/h3>\n\n\n\n\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n\n\t\n\n\t\n\n<li>\n\n<section>\u53ef\u80fd\u5bfc\u81f4\u5185\u5b58\u5360\u7528\u8fc7\u591a,\u56e0\u4e3a\u95ed\u5305\u643a\u5e26\u4e86\u81ea\u8eab\u7684\u51fd\u6570\u4f5c\u7528\u57df<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u95ed\u5305\u53ea\u80fd\u53d6\u5f97\u5916\u90e8\u5305\u542b\u51fd\u6570\u4e2d\u5f97\u6700\u540e\u4e00\u4e2a\u503c<\/section>\n\n<\/li>\n\n\n\n<\/ul>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u8be6\u89c1<a href='https:\/\/segmentfault.com\/a\/1190000014540734?utm_source=channel-hottest'>https:\/\/segmentfault.com\/a\/11...<\/a><\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">131\u3001a:active \u79fb\u52a8\u7aef\u5b9e\u73b0<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6709\u65f6\u5019\u4e00\u4e9b\u6309\u94ae\u7684\u7b80\u5355\u70b9\u51fb\u4ea4\u4e92\u53ef\u4ee5\u901a\u8fc7css\u4f2a\u7c7b\u6765\u5b9e\u73b0\uff1b\u5fc5\u987b\u70b9\u51fb\u4e86\u66f4\u6539\u989c\u8272\uff1b\u677e\u5f00\u6062\u590d\uff1bIOS\u624b\u673a\u4f1a\u51fa\u73b0\u4f2a\u7c7b\u65e0\u6548\u7684\u60c5\u51b5\uff1biOS\u7cfb\u7edf\u7684\u79fb\u52a8\u8bbe\u5907\u4e2d\uff0c\u9700\u8981\u5728\u6309\u94ae\u5143\u7d20\u6216body\/html\u4e0a\u7ed1\u5b9a\u4e00\u4e2atouchstart\u4e8b\u4ef6\u624d\u80fd\u6fc0\u6d3b:active\u72b6\u6001\u3002<\/p>\n\n\n\n\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;\">document.body.addEventListener(&#39;touchstart&#39;, function () { \/\/...\u7a7a\u51fd\u6570\u5373\u53ef});\n<\/code><\/pre>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">132\u3001ios\u6ed1\u52a8\u5361\u987f<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">-webkit-overflow-scrolling:touch \u53ef\u80fd\u4f1a\u5728IOS\u7cfb\u7edf\u4f4e\u7684\u60c5\u51b5\u51fa\u73b0\u6eda\u52a8\u6761\uff1b\u5c1d\u8bd5\u6ea2\u51fa\u89e3\u51b3<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">133\u3001forEach\u548cmap\u7684\u533a\u522b<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u76f8\u540c\u70b9<\/p>\n\n\n\n\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n\n\t\n\n\t\n\n<li>\n\n<section>\u90fd\u662f\u5faa\u73af\u904d\u5386\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u9879<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>forEach\u548cmap\u65b9\u6cd5\u91cc\u6bcf\u6b21\u6267\u884c\u533f\u540d\u51fd\u6570\u90fd\u652f\u63013\u4e2a\u53c2\u6570\uff0c\u53c2\u6570\u5206\u522b\u662fitem\uff08\u5f53\u524d\u6bcf\u4e00\u9879\uff09\u3001index\uff08\u7d22\u5f15\u503c\uff09\u3001arr\uff08\u539f\u6570\u7ec4\uff09<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u533f\u540d\u51fd\u6570\u4e2d\u7684this\u90fd\u662f\u6307\u5411window<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u53ea\u80fd\u904d\u5386\u6570\u7ec4<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>\u90fd\u6709\u517c\u5bb9\u95ee\u9898<\/section>\n\n<\/li>\n\n\n\n<\/ul>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u4e0d\u540c\u70b9<\/p>\n\n\n\n\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n\n\t\n\n\t\n\n<li>\n\n<section>map\u901f\u5ea6\u6bd4foreach\u5feb<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>map\u4f1a\u8fd4\u56de\u4e00\u4e2a\u65b0\u6570\u7ec4\uff0c\u4e0d\u5bf9\u539f\u6570\u7ec4\u4ea7\u751f\u5f71\u54cd,foreach\u4e0d\u4f1a\u4ea7\u751f\u65b0\u6570\u7ec4\uff0c<\/section>\n\n<\/li>\n\n\n\n\t\n\n\t\n\n<li>\n\n<section>map\u56e0\u4e3a\u8fd4\u56de\u6570\u7ec4\u6240\u4ee5\u53ef\u4ee5\u94fe\u5f0f\u64cd\u4f5c\uff0cforeach\u4e0d\u80fd<\/section>\n\n<\/li>\n\n\n\n<\/ul>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">134\u3001\u6d45\u62f7\u8d1d\u548c\u6df1\u62f7\u8d1d<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">jQuery.extend\u7b2c\u4e00\u4e2a\u53c2\u6570\u53ef\u4ee5\u662f\u5e03\u5c14\u503c\uff0c\u7528\u6765\u8bbe\u7f6e\u662f\u5426\u6df1\u5ea6\u62f7\u8d1d\u7684<\/p>\n\n\n\n\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;\">jQuery.extend(true, { a : { a : &quot;a&quot; } }, { a : { b : &quot;b&quot; } } );\njQuery.extend( { a : { a : &quot;a&quot; } }, { a : { b : &quot;b&quot; } } ); \n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6700\u7b80\u5355\u7684\u6df1\u62f7\u8d1d<\/p>\n\n\n\n\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;\">aa = JSON.parse( JSON.stringify(a) )\n<\/code><\/pre>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u6d45\u590d\u5236---&gt;\u5c31\u662f\u5c06\u4e00\u4e2a\u5bf9\u8c61\u7684\u5185\u5b58\u5730\u5740\u7684\u201c\u201d\u7f16\u53f7\u201c\u201d\u590d\u5236\u7ed9\u53e6\u4e00\u4e2a\u5bf9\u8c61\u3002\u6df1\u590d\u5236---&gt;\u5b9e\u73b0\u539f\u7406\uff0c\u5148\u65b0\u5efa\u4e00\u4e2a\u7a7a\u5bf9\u8c61\uff0c\u5185\u5b58\u4e2d\u65b0\u5f00\u8f9f\u4e00\u5757\u5730\u5740\uff0c\u628a\u88ab\u590d\u5236\u5bf9\u8c61\u7684\u6240\u6709\u53ef\u679a\u4e3e\u7684(\u6ce8\u610f\u53ef\u679a\u4e3e\u7684\u5bf9\u8c61)\u5c5e\u6027\u65b9\u6cd5\u4e00\u4e00\u590d\u5236\u8fc7\u6765\uff0c\u6ce8\u610f\u8981\u7528\u9012\u5f52\u6765\u590d\u5236\u5b50\u5bf9\u8c61\u91cc\u9762\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u76f4\u5230\u5b50\u5b50.....\u5c5e\u6027\u4e3a\u57fa\u672c\u6570\u636e\u7c7b\u578b\u3002\u603b\u7ed3\uff0c\u6df1\u590d\u5236\u7406\u89e3\u4e24\u70b9\uff0c1,\u65b0\u5f00\u8f9f\u5185\u5b58\u5730\u5740\uff0c2,\u9012\u5f52\u6765\u5228\u6839\u590d\u5236\u3002<\/p>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">135\u3001\u5916\u8fb9\u8ddd\u5408\u5e76<\/h3>\n\n\n\n\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\n\u5916\u8fb9\u8ddd\u5408\u5e76\u6307\u7684\u662f\uff0c\u5f53\u4e24\u4e2a\u5782\u76f4\u5916\u8fb9\u8ddd\u76f8\u9047\u65f6\uff0c\u5b83\u4eec\u5c06\u5f62\u6210\u4e00\u4e2a\u5916\u8fb9\u8ddd\u3002\n \u5408\u5e76\u540e\u7684\u5916\u8fb9\u8ddd\u7684\u9ad8\u5ea6\u7b49\u4e8e\u4e24\u4e2a\u53d1\u751f\u5408\u5e76\u7684\u5916\u8fb9\u8ddd\u7684\u9ad8\u5ea6\u4e2d\u7684\u8f83\u5927\u8005\u3002\n\n<\/blockquote>\n\n\n\n\n<h3 style=\"padding: 0px; color: #4870ac; margin: 1.2em 0px 1em; font-size: 1.3em;\">136\u3001js\u52a0\u8f7d\u4f4d\u7f6e\u533a\u522b\u4f18\u7f3a\u70b9<\/h3>\n\n\n\n\n<p style=\"margin: 1em 0px;\">html\u6587\u4ef6\u662f\u81ea\u4e0a\u800c\u4e0b\u7684\u6267\u884c\u65b9\u5f0f\uff0c\u4f46\u5f15\u5165\u7684css\u548cjavascript\u7684\u987a\u5e8f\u6709\u6240\u4e0d\u540c\uff0ccss\u5f15\u5165\u6267\u884c\u52a0\u8f7d\u65f6\uff0c\u7a0b\u5e8f\u4ecd\u7136\u5f80\u4e0b\u6267\u884c\uff0c\u800c\u6267\u884c\u5230<script>\u811a\u672c\u662f\u5219\u4e2d\u65ad\u7ebf\u7a0b\uff0c\u5f85\u8be5script\u811a\u672c\u6267\u884c\u7ed3\u675f\u4e4b\u540e\u7a0b\u5e8f\u624d\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c\u3002 \u6240\u4ee5\uff0c\u5927\u90e8\u5206\u7f51\u4e0a\u8ba8\u8bba\u662f\u5c06script\u811a\u672c\u653e\u5728<body>\u4e4b\u540e\uff0c\u90a3\u6837dom\u7684\u751f\u6210\u5c31\u4e0d\u4f1a\u56e0\u4e3a\u957f\u65f6\u95f4\u6267\u884cscript\u811a\u672c\u800c\u5ef6\u8fdf\u963b\u585e\uff0c\u52a0\u5feb\u4e86\u9875\u9762\u7684\u52a0\u8f7d\u901f\u5ea6\u3002<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u4f46\u53c8\u4e0d\u80fd\u5c06\u6240\u6709\u7684script\u653e\u5728body\u4e4b\u540e\uff0c\u56e0\u4e3a\u6709\u4e00\u4e9b\u9875\u9762\u7684\u6548\u679c\u7684\u5b9e\u73b0\uff0c\u662f\u9700\u8981\u9884\u5148\u52a8\u6001\u7684\u52a0\u8f7d\u4e00\u4e9bjs\u811a\u672c\u3002\u6240\u4ee5\u8fd9\u4e9b\u811a\u672c\u5e94\u8be5\u653e\u5728<body>\u4e4b\u524d\u3002<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\u5176\u6b21\uff0c\u4e0d\u80fd\u5c06\u9700\u8981\u8bbf\u95eedom\u5143\u7d20\u7684js\u653e\u5728body\u4e4b\u524d\uff0c\u56e0\u4e3a\u6b64\u65f6\u8fd8\u6ca1\u6709\u5f00\u59cb\u751f\u6210dom\uff0c\u6240\u4ee5\u5728body\u4e4b\u524d\u7684\u8bbf\u95eedom\u5143\u7d20\u7684js\u4f1a\u51fa\u9519\uff0c\u6216\u8005\u65e0\u6548<\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\"><strong style=\"color: #4870ac;\">script\u653e\u7f6e\u4f4d\u7f6e\u7684\u539f\u5219\u201c\u9875\u9762\u6548\u679c\u5b9e\u73b0\u7c7b\u7684js\u5e94\u8be5\u653e\u5728body\u4e4b\u524d\uff0c\u52a8\u4f5c\uff0c\u4ea4\u4e92\uff0c\u4e8b\u4ef6\u9a71\u52a8\uff0c\u9700\u8981\u8bbf\u95eedom\u5c5e\u6027\u7684js\u90fd\u53ef\u4ee5\u653e\u5728body\u4e4b\u540e<\/strong><\/p>\n\n\n\n\n<p style=\"margin: 1em 0px;\">\/\/ ]]><\/script><\/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\u9762\u8bd5\u9898\u6309\u9898\u53f7\u8bb0\u6982\u5ff5\u4e0e\u4ee3\u7801\uff0c\u5148\u641e\u6e05\u7c7b\u578b\u3001\u4f5c\u7528\u57df\u3001\u539f\u578b\u548c\u5f02\u6b65\uff0c\u518d\u8865 DOM \u4e0e\u517c\u5bb9\u5199\u6cd5\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u4efd JavaScript \u9762\u8bd5\u9898 \u8be6\u7ec6\u7248\uff0c\u4ece typeof\u3001\u7c7b\u578b\u8f6c\u6362\u3001\u6570\u7ec4\u65b9\u6cd5\u8bb2\u5230\u95ed\u5305\u3001\u539f\u578b\u3001\u5f02\u6b65\u548c D [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[105,128],"tags":[150,140],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3002"}],"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=3002"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3002\/revisions"}],"predecessor-version":[{"id":3005,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3002\/revisions\/3005"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}