{"id":2626,"date":"2020-04-13T20:51:52","date_gmt":"2020-04-13T12:51:52","guid":{"rendered":"http:\/\/www.yuguoxy.com\/geekhome\/?p=2626"},"modified":"2020-04-14T09:03:18","modified_gmt":"2020-04-14T01:03:18","slug":"2019%e5%b9%b4%e5%89%8d%e7%ab%af%e9%9d%a2%e8%af%95%e9%a2%98%e6%80%bb%e7%bb%93%e4%bb%a5%e5%8f%8a%e4%b8%80%e4%ba%9b%e9%9d%a2%e8%af%95%e5%bf%83%e5%be%97%ef%bc%88%e9%99%84%e7%ad%94%e6%a1%88%ef%bc%89","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=2626","title":{"rendered":"2019\u5e74\u524d\u7aef\u9762\u8bd5\u9898\u603b\u7ed3\u4ee5\u53ca\u4e00\u4e9b\u9762\u8bd5\u5fc3\u5f97\uff08\u9644\u7b54\u6848\uff09"},"content":{"rendered":"<p><strong>\u524d\u6cbf<\/strong><\/p>\n<p><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/04\/timg.jpg\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\" size-full wp-image-2628 aligncenter\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/04\/timg.jpg\" alt=\"timg\" width=\"500\" height=\"300\" \/><\/a><\/p>\n<p>\u5c0f\u7f16\u5728\u8fd9\u51e0\u5e74\u7684\u524d\u7aef\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5386\u4e86\u7531js,jquery\u5230vue,\u7531\u64cd\u4f5cdom\u5230\u6570\u636e\u9a71\u52a8\u9875\u9762\uff0c\u7531\u53ea\u5199pc\u7f51\u7ad9\uff0c\u5230\u5199\u79fb\u52a8\u7aef\u7f51\u9875\uff0c\u518d\u5230\u79fb\u52a8\u7aefapp,\u518d\u5230\u5fae\u4fe1\u516c\u4f17\u53f7\uff0c\u5c0f\u7a0b\u5e8f\uff0c\u53ef\u8c13\u662f\u98ce\u4e91\u53d8\u5e7b\uff0c\u4e0d\u5f97\u4e0d\u611f\u53f9H5\u7684\u80fd\u529b\u8d8a\u6765\u8d8a\u5f3a\uff0c\u6b63\u6240\u8c13\u5b66\u5230\u8001\uff0c\u6d3b\u5230\u8001\u5927\u6982\u8bf4\u7684\u5c31\u662f\u7a0b\u5e8f\u5458\u5427\u3002\u5728\u60b2\u50ac\u7684\u7ecf\u5386\u4e86\u4e92\u8054\u7f51\u516c\u53f8\u4e00\u5bb6\u53c8\u4e00\u5bb6\u5012\u95ed\uff0c\u5e26\u6765\u7684\u662f\u6211\u4e5f\u7ecf\u5386\u4e86\u65e0\u6570\u6b21\u7684\u9762\u8bd5\uff0c\u4e5f\u7b97\u662f\u7cfb\u7edf\u7684\u8fc7\u4e86\u4e00\u904d\u77e5\u8bc6\u4f53\u7cfb\u3002<\/p>\n<p>\u5728\u8fd9\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0\u4e86\u597d\u591a\u81ea\u5df1\u7684\u4e0d\u8db3\u4e4b\u5904\uff0c\u4e8e\u662f\u603b\u7ed3\u4e0b\u6765\uff0c\u4ee5\u65b9\u4fbf\u540e\u7eed\u5b66\u4e60\u3002\u53ef\u80fd\u8fd8\u6709\u4e00\u4e9b\u4e0d\u5168\u9762\u5bf9\u7684\u5730\u65b9\uff0c\u5e0c\u671b\u7b80\u53cb\u770b\u89c1\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u6307\u6b63\uff0c\u8865\u5145\uff0c\u8c22\u8c22\u3002<\/p>\n<p>\u6ce8\u91ca\uff1a\u968f\u7740\u524d\u7aef\u6280\u672f\u7684\u53d1\u5c55\uff0c\u672c\u7bc7\u7b80\u6587\u4f1a\u6301\u7eed\u66f4\u65b0\uff0c\u8bf7\u5173\u6ce8\u66f4\u65b0\u3002<\/p>\n<blockquote><p>\u968f\u7740\u524d\u7aef\u7684\u53d1\u5c55\uff0c\u6d8c\u73b0\u51fa\u8d8a\u6765\u8d8a\u591a\u7684\u6846\u67b6,\u77e5\u8bc6\u4f53\u7cfb\uff0c\u6240\u4ee5\u5c0f\u4f19\u4f34\u4eec\u5b66\u4e60\u7684\u8def\u8fd8\u5f88\u957f\u3002\u5c31\u76ee\u524d\u72b6\u51b5\u6765\u770b\uff0c\u524d\u7aef\u9762\u8bd5\u5206\u4e3a\u4ee5\u4e0b\u51e0\u5927\u7c7b\u3002<\/p>\n<p>1\u3001css3<br \/>\n2\u3001javaScript<br \/>\n3\u3001jquery<br \/>\n4\u3001HTML5\u65b0\u7279\u6027\u548c\u8bed\u4e49\u5316<br \/>\n5\u3001Vue,React,Angular<br \/>\n6\u3001ES6<br \/>\n7\u3001Webpack<br \/>\n8\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\uff0c\u5c0f\u7a0b\u5e8f\uff0c\u5c0f\u6e38\u620f<br \/>\n9\u3001Dcloud\u5f00\u53d1\uff0c\u4e00\u5957\u4ee3\u7801\u591a\u7ec8\u7aef<br \/>\n10\u3001\u5927\u6570\u636e\u53ef\u89c6\u5316<br \/>\n11\u3001node.js<br \/>\n12\u3001\u5f53\u7136\u4f60\u8981\u662f\u4f1ajava\u6216\u8005\u5176\u4ed6\u8bed\u8a00\uff0c\u90a3\u5c31\u8fd8\u6709\u5176\u4ed6\u8bed\u8a00\u3002<\/p><\/blockquote>\n<p><strong>\u5173\u952e\u70b9\u4e00\uff1aCSS3<\/strong><\/p>\n<p><strong>1\uff0c\u63cf\u8ff0\u4e00\u4e0b\u4f60\u8ba4\u4e3a\u7684\u76d2\u5b50\u6a21\u578b?<\/strong><\/p>\n<blockquote><p>\u7b54\u6848\uff1a\u76d2\u5b50\u6a21\u578b\u5206\u4e3aie\u76d2\u5b50\u6a21\u578b\u548cw3c\u76d2\u5b50\u6a21\u578b<\/p><\/blockquote>\n<p>\u25cf\u3000ie\u7684\u76d2\u5b50\u6a21\u578b\u5305\u62ec\uff08margin(\u5916\u8fb9\u8ddd)\uff0cpadding(\u5185\u8fb9\u8ddd)\uff0c\u8fb9\u6846(border\uff09,\u5185\u5bb9(content) (ie\u7684width=content+padding+borde) \uff09;<\/p>\n<p>\u25cf\u3000w3c\u7684\u76d2\u5b50\u6a21\u578b\u5305\u62ec\uff08margin(\u5916\u8fb9\u8ddd)\uff0cpadding(\u5185\u8fb9\u8ddd)\uff0c\u8fb9\u6846(border\uff09,\u5185\u5bb9(content) w3c\u7684width=content\uff09<\/p>\n<p><strong>2\uff0ccss3\u7684\u9009\u62e9\u5668\u6709\u54ea\u51e0\u79cd\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a*\u901a\u7528\u9009\u62e9\u5668\uff0cID\u9009\u62e9\u5668 \uff0c.\u7c7b\u9009\u62e9\u5668class\uff0c\u6807\u7b7e\u9009\u62e9\u5668\uff0c\u6807\u7b7e\u7ec4\u5408\u9009\u62e9\u5668\uff0c\u4f2a\u7c7b\u9009\u62e9\u5668\uff1a\uff0c+\u76f8\u90bb\u5143\u7d20\u9009\u62e9\u5668\uff0c&gt;\u5b50\u5143\u7d20\u9009\u62e9\u5668\uff0c~\u540c\u8f88\u9009\u62e9\u5668\uff0c<\/p>\n<p>x[title]\u5c5e\u6027\u9009\u62e9\u5668[type=&#8221;button&#8221;]\uff0c<\/p>\n<p>x[href^=&#8221;http&#8221;]\u5339\u914d\u4ee5href\u503c\u4e3ahttp\u6253\u5934\u7684\u5730\u5740\uff0c<\/p>\n<p>x[href$=&#8221;.jpg&#8221;]\u5339\u914d\u6240\u6709\u7684\u56fe\u7247\u94fe\u63a5\uff0c<\/p>\n<p>input[type=checkbox]:checked{};\u9009\u62e9checkbox\u4e3a\u5f53\u524d\u9009\u4e2d\u7684\u90a3\u4e2a\u6807\u7b7e\u3002<\/p>\n<blockquote><p>\u4f2a\u7c7b\u9009\u62e9\u5668\uff1a<\/p>\n<p>p:empty \u9009\u62e9\u6ca1\u6709\u5b50\u5143\u7d20\u7684\u6bcf\u4e2a &lt;p&gt; \u5143\u7d20\uff08\u5305\u62ec\u6587\u672c\u8282\u70b9\uff09\u3002<br \/>\n:first-child \u7b2c\u4e00\u4e2a<br \/>\n:last-child \u6700\u540e\u4e00\u4e2a<br \/>\n:nth-child(11) 1&#8211;11\u4e2a<br \/>\nx:first\/x:after \u5728x\u9009\u62e9\u5668\u4e4b\u524d\u6216\u8005\u4e4b\u540e\u63d2\u5165\u5185\u5bb9<\/p>\n<p>\u4f2a\u5143\u7d20\u9009\u62e9\u5668<\/p>\n<p>::before ,::after \u901a\u8fc7 css \u6a21\u62df\u51fa\u6765html\u6807\u7b7e\u7684\u6548\u679c<\/p><\/blockquote>\n<p><strong>3\uff0c\u8bf7\u5199\u51facss3\u6837\u5f0f\u7684\u4f18\u5148\u7ea7,\u5e76\u6392\u5e8f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a!important(\u6743\u91cd\u6700\u5927)1000&gt;\u5185\u5d4c\u6837\u5f0f\uff08style=&#8221;&#8221;\uff09&gt;\u5185\u90e8\u6837\u5f0f&gt;\u5916\u8054\u6837\u5f0f&gt;@import url(&#8220;url&#8221;);<\/p>\n<p><strong>4\uff0ccss3\u7684\u65b0\u7279\u6027<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\n1\u3001@font-face\u52a0\u8f7d\u5b57\u4f53\u6837\u5f0f\uff1b<\/p>\n<p>2\u3001\u6587\u5b57\u6e32\u67d3\uff0ctext-decoration,text-fill-color:\u6587\u5b57\u5185\u90e8\u586b\u5145\u989c\u8272\uff0ctext-stroke-color:\u6587\u5b57\u8fb9\u6846\u586b\u5145\u989c\u8272\uff0ctext-stroke-width:\u6587\u5b57\u8fb9\u754c\u5bbd\u5ea6\u3002<\/p>\n<p>3\u3001css3\u7684\u591a\u5217\u5e03\u5c40 Column-count\uff1a\u8868\u793a\u5e03\u5c40\u51e0\u5217\u3002Column-rule\uff1a\u8868\u793a\u5217\u4e0e\u5217\u4e4b\u95f4\u7684\u95f4\u9694\u6761\u7684\u6837\u5f0f Column-gap\uff1a\u8868\u793a\u5217\u4e8e\u5217\u4e4b\u95f4\u7684\u95f4\u9694\u3002<\/p>\n<p>4\u3001\u8fb9\u6846\u5706\u89d2\u7684\u5e03\u5c40\u3002border-radius:50px;<\/p>\n<p>5\u3001css3\u7684\u6e10\u53d8\u6548\u679c\uff0c \uff08gradient\uff09<\/p>\n<p>6\u3001css3\u7684\u9634\u5f71\u6548\u679c\u56fe \uff08shadow\u53cd\u5c04\u548creflect\u53cd\u5c04\u6548\u679c\uff09<\/p>\n<p>7\u3001css3\u7684\u591a\u80cc\u666f\u56fe\u7247<\/p>\n<p>8\u3001css3\u7684\u52a8\u753b\u6548\u679c animation<\/p>\n<p><strong>5\uff0c\u884c\u5185\u5143\u7d20\u6709\u54ea\u4e9b\uff1f\u5757\u7ea7\u5143\u7d20\u4e0e\u90a3\u4e9b\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000\u5757\u7ea7\u5143\u7d20\uff1adiv\/p\/form\/ul\/li\/ol\/hr\/fieldset\/table\/dd\/dt\/dl<\/p>\n<p>\u25cf\u3000\u884c\u5185\u5143\u7d20\uff1aspan\/strong\/a\/b\/em\/img\/input\/lable\/small\/sub<\/p>\n<p><strong>6\uff0c\u4e3a\u4ec0\u4e48\u4f7f\u7528css3\u548cdiv\u5e03\u5c40\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\n1\uff0c\u4ee3\u7801\u7cbe\u7b80\uff08\u6ca1\u6709\u672c\u8eab\u81ea\u5e26\u7684\u4e00\u4e9b\u5c5e\u6027\uff0c\u5bb9\u6613\u8bbe\u7f6e\u6837\u5f0f\uff09<br \/>\n2\uff0c\u89e3\u51b3\u4e86table\u8868\u683c\u7684\u5d4c\u5957\u95ee\u9898<br \/>\n3\uff0c\u901f\u5ea6\u95ee\u9898\uff08\u9875\u9762\u4ee3\u7801\u51cf\u5c11\uff0c\u589e\u52a0\u4e86\u7f16\u5199\u4ee3\u7801\u7684\u901f\u5ea6\uff09<br \/>\n4 ,\u5bf9\u6392\u540d\u7684\u5f71\u54cd\uff0c\u57fa\u4e8exhtml\u6807\u51c6\u7684div+css\u5e03\u5c40\u4f1a\u66f4\u5feb\u7684\u901a\u8fc7w3c\u6807\u51c6<\/p>\n<p><strong>7\uff0c\u9690\u85cf\u4e00\u4e2abutton\u7684\u65b9\u6cd5\uff082\u79cd\uff09\uff0c\u5199\u51fa\u4e00\u4e2abutton\u7684\u6309\u94ae\uff082\u79cd\uff09<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u9690\u85cf\u4e00\u4e2abutton\u7684\u65b9\u6cd5\uff1a<\/p>\n<p>\u25cf\u3000display:none;<br \/>\n\u25cf\u3000visibility\uff1ahidden\uff1b<\/p>\n<p>\u5199\u51fa\u4e00\u4e2abutton\u7684\u6309\u94ae\uff1a<\/p>\n<p>\u25cb\u3000&lt;input type = button&gt;<br \/>\n\u25cb\u3000&lt;button&gt;\u8fd9\u662f\u4e00\u4e2a\u6309\u94ae &lt;\/button&gt;<\/p>\n<p><strong>8\uff0c\u8bf7\u7b80\u8ff0web\u5f00\u53d1\u4e2d\u7684\u517c\u5bb9\u95ee\u9898<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>1\uff0c\u6d4f\u89c8\u5668\u9ed8\u8ba4\u7684\u5185\u5916\u8fb9\u8ddd\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u7528\u901a\u7528\u9009\u62e9\u5668*\u8bbe\u7f6emargin\u548cpadding\u6765\u8bbe\u7f6e\u3002<\/p>\n<p>2\uff0c\u5757\u6807\u7b7e\u8bbe\u7f6e\u6d6e\u52a8\u540e\uff0c\u6709\u8bbe\u7f6emargin\u7684\u60c5\u51b5\u4e0b\uff0c\u5728ie6\u4e0b\u7684margin\u6bd4\u522b\u7684\u6d4f\u89c8\u5668\u5927\u3002<\/p>\n<p>3\uff0cimg\u6807\u7b7e\u4f1a\u6709\u9ed8\u8ba4\u7684\u95f4\u8ddd\uff0c\u9700\u8981\u7528\u6d6e\u52a8\u53bb\u8bbe\u7f6e<\/p>\n<p>4\uff0c\u706b\u72d0\u6d4f\u89c8\u5668\u4e2d\u7684\u70b9\u51fb\u4e8b\u4ef6\u548c\u6eda\u52a8\u4e8b\u4ef6\u9700\u8981\u52a0\uff08event\uff09\u6765\u517c\u5bb9<\/p>\n<p>5\uff0cdiv\u91cc\u7684\u5185\u5bb9\uff0cie\u9ed8\u8ba4\u4e3a\u5c45\u4e2d\uff0cfirefox\u9ed8\u8ba4\u4e3a\u5de6\u5bf9\u9f50\uff0c\u9700\u8981\u7528margin:0px auto\u6765\u8c03\u8282<\/p>\n<p>6\uff0ccss3\u7684\u52a8\u753b\u6548\u679c\u4e0d\u517c\u5bb9ie8\u4ee5\u4e0b\u3002\u9700\u8981\u4f7f\u7528js\u53bb\u5199\u52a8\u753b\u3002<\/p>\n<p>7\uff0cie6\u7684\u53cc\u500d\u8fb9\u8ddd\uff0c\u6bd4\u5982\u8bbe\u7f6e\u4e86margin:10px,ie6\u4e2d\u9ed8\u8ba4\u4e3a20px\uff0c\u9700\u8981\u4f7f\u7528display:inline,block.<\/p>\n<p><strong>9\uff0ccss3\u5b9e\u73b0\u6c34\u5e73\u5782\u76f4\u5c45\u4e2d&#8212;&#8212;(\u7279\u522b\u6ce8\u610f\uff0c\u91cc\u8fb9\u7684\u56fa\u5b9a\u8fd8\u662f\u4e0d\u56fa\u5b9a)<\/strong><\/p>\n<p>a,&#8212;-\u5b9a\u4f4d\u65b9\u5f0f\uff08\u7236\u5143\u7d20\u5bbd\u9ad8\u56fa\u5b9a\uff0c\u5b50\u5143\u7d20\u5bbd\u9ad8\u56fa\u5b9a\uff09<\/p>\n<pre class=\"brush:css;toolbar:false;\"> &lt;div&gt;\r\n        &lt;div&gt;&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;style scoped&gt;\r\n   .Father{\r\n     position: relative;\r\n   }\r\n   .children{\r\n     width: 50px;\r\n     height: 50px;\r\n     position: absolute;\r\n     top: 0px;\r\n     bottom: 0px;\r\n     left: 0px;\r\n     right: 0px;\r\n     margin: auto;\r\n   }\r\n&lt;\/style&gt;<\/pre>\n<p>b, &#8212;-flex\u5e03\u5c40\u65b9\u5f0f\uff08\u7236\u5143\u7d20\u5bbd\u9ad8\u4e0d\u56fa\u5b9a\uff0c\u5b50\u5143\u7d20\u5bbd\u9ad8\u4e0d\u56fa\u5b9a\uff09<\/p>\n<pre class=\"brush:css;toolbar:false;\">    &lt;div&gt;\r\n        &lt;div&gt;&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;style scoped&gt;\r\n  .Father {\r\n    border: 1px solid red;\r\n    height: 100px;\r\n    display: flex;\r\n    justify-content: center;\r\n    align-items: center;\r\n  }\r\n  .children {\r\n    width: 50px;\r\n    height: 50px;\r\n    border: 1px solid blue;\r\n  }\r\n&lt;\/style&gt;<\/pre>\n<p>c, &#8212;-transform\u65b9\u5f0f\uff08\u7236\u5143\u7d20\u5bbd\u9ad8\u4e0d\u56fa\u5b9a\uff0c\u5b50\u5143\u7d20\u5bbd\u9ad8\u4e0d\u56fa\u5b9a\uff09<\/p>\n<pre class=\"brush:css;toolbar:false;\">    &lt;div&gt;\r\n        &lt;div&gt;&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;style scoped&gt;\r\n  .Father {\r\n    border: 1px solid red;\r\n    height: 100px;\r\n    position: relative;\r\n  }\r\n  .children {\r\n    width: 50px;\r\n    height: 50px;\r\n    border: 1px solid blue;\r\n    position: absolute;\r\n    top: 50%;\r\n    left: 50%;\r\n    transform: translate(-50%, -50%);  \/* \u4f7f\u7528css3\u7684transform\u6765\u5b9e\u73b0 *\/\r\n  }\r\n&lt;\/style&gt;<\/pre>\n<p><strong>10\uff0ccss3\u5b9e\u73b0\u5de6\u4fa7\u56fa\u5bbd\uff0c\u53f3\u4fa7\u968f\u7740\u5c4f\u5e55\uff0c\u53f3\u4fa7\u968f\u7740\u5c4f\u5e55\u53d8\u5316\u800c\u53d8\u5316<\/strong><\/p>\n<p>A, &#8212;-float+calc(css3\u65b0\u5c5e\u6027\u8ba1\u7b97\u5c5e\u6027)\u65b9\u5f0f<\/p>\n<pre class=\"brush:css;toolbar:false;\">   &lt;div&gt;\r\n      &lt;div&gt;\u6211\u662f\u5de6\u4fa7&lt;\/div&gt;\r\n      &lt;div&gt;\u6211\u662f\u53f3\u4fa7&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;style  rel=\"stylesheet\/scss\"&gt;\r\n  .Father {\r\n    border: 1px solid red;\r\n    height: 100px;\r\n  }\r\n  .LeftChildren {\r\n    width: 50px;\r\n    border: 1px solid blue;\r\n    float: left;\r\n  }\r\n  .RightChildren {\r\n    width: calc(100% - 50px);\r\n    border: 1px solid green;\r\n    float: right;\r\n  }\r\n}\r\n&lt;\/style&gt;<\/pre>\n<p>B, &#8212;-flex\u65b9\u5f0f<\/p>\n<pre class=\"brush:css;toolbar:false;\">   &lt;div&gt;\r\n      &lt;div&gt;\u6211\u662f\u5de6\u4fa7&lt;\/div&gt;\r\n      &lt;div&gt;\u6211\u662f\u53f3\u4fa7&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;style  rel=\"stylesheet\/scss\"&gt;\r\n  .Father {\r\n    border: 1px solid red;\r\n    height: 100px;\r\n    display: flex;\r\n  }\r\n  .LeftChildren {\r\n    width: 50px;\r\n    border: 1px solid blue;\r\n  }\r\n  .RightChildren {\r\n    border: 1px solid green;\r\n    flex: 1;\r\n  }\r\n&lt;\/style&gt;<\/pre>\n<p><strong>11\uff0c\u8bf7\u5199\u51fa\u4f60\u4f7f\u7528\u8fc7\u7684\u6d4f\u89c8\u5668\uff1f\u5e76\u5199\u51fa\u6d4f\u89c8\u5668\u7684\u5185\u6838\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<blockquote><p>IE(\u5185\u6838\uff1atrident); internet explorer<br \/>\n\u706b\u72d0\u6d4f\u89c8\u5668mozilla firefox (\u5185\u6838\uff1agecko)<br \/>\n\u8c37\u6b4c\u6d4f\u89c8\u5668chrome(\u5185\u6838\uff1awebkit)<br \/>\nopera\u6d4f\u89c8\u5668\uff08\u5185\u6838\uff1apresto\uff09<\/p><\/blockquote>\n<p><strong>12\uff0cem,rem,px\u7684\u533a\u522b\uff0c\u4ee5\u53ca\u5b9e\u73b0\u539f\u7406\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000px\u50cf\u7d20\uff08Pixel\uff09\u3002\u76f8\u5bf9\u957f\u5ea6\u5355\u4f4d\u3002\u50cf\u7d20px\u662f\u76f8\u5bf9\u4e8e\u663e\u793a\u5668\u5c4f\u5e55\u5206\u8fa8\u7387\u800c\u8a00\u7684\u3002<\/p>\n<p>\u25cf\u3000em\u662f\u76f8\u5bf9\u957f\u5ea6\u5355\u4f4d\u3002\u76f8\u5bf9\u4e8e\u5f53\u524d\u5bf9\u8c61\u5185\u6587\u672c\u7684\u5b57\u4f53\u5c3a\u5bf8<\/p>\n<blockquote><p>\u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p>\u6bd4\u5982\u8bf4\u5f53\u524d\u5bb9\u5668`font-size:16px;`\u5219`1em`\u5c31\u7b49\u4e8e16px;<\/p><\/blockquote>\n<p>\u25cf\u3000rem \u662fCSS3\u65b0\u589e\u7684\u4e00\u4e2a\u76f8\u5bf9\u5355\u4f4d\uff08\u76f8\u5bf9\u4e8e\u6839\u5143\u7d20\u7684\uff09,\u4f7f\u7528\u65b9\u6cd5\u5c31\u662f<\/p>\n<blockquote><p>\u6d4f\u89c8\u5668\u7684\u9ed8\u8ba4\u5b57\u4f53\u662f16px\uff0c\u90a3\u4e48`1rem=16px`\u4ee5\u6b64\u7c7b\u63a8\u8ba1\u7b9712px=0.75rem\uff0c10px=0.625rem\uff0c2rem=32px\uff1b<\/p>\n<p>\u8fd9\u6837\u4f7f\u7528\u5f88\u590d\u6742\u3002<\/p><\/blockquote>\n<p>\u73b0\u5728\u6709\u4e00\u4e2a\u6839\u636e\u6d4f\u89c8\u5668\u5c3a\u5bf8\u8ba1\u7b97\u5927\u5c0f\u7684rem\u7684\u8ba1\u7b97\u65b9\u6cd5\uff0c\u4f7f\u7528\u79fb\u52a8\u7aef\uff0c\u8be6\u60c5\u8bf7\u67e5\u770b<a href=\"https:\/\/www.jianshu.com\/p\/cfabfa4727ba\" target=\"_blank\" rel=\"nofollow\">\u524d\u7aef\u5f00\u53d1\u516c\u5171css\uff0cjs\u7b14\u8bb0<\/a><\/p>\n<p><strong>13\uff0ccss3\u6e05\u9664\u6d6e\u52a8\u7684\u65b9\u5f0f\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<pre class=\"brush:html;toolbar:false\">&lt;div class=\"father\" style=\"overflow: hidden;\"&gt;\r\n       &lt;div class=\"type_lei_left\"&gt;\u5907\u6ce8&lt;\/div&gt;\r\n       &lt;div class=\"type_lei_left_1\" style=\"word-break: break-all;word-wrap: break-word;\"&gt;&lt;\/div&gt;\r\n        &lt;div style=\"clear: both;display: none;\"&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>\u7236\u7ea7div\u52a0overflow: hidden;\uff0c\u5728\u7236\u7ea7div\u7684\u6700\u540e\u6e05\u9664\u6240\u6709\u3002<\/p>\n<p><strong>\u5173\u952e\u70b9\u4e8c\uff1aHTML5<\/strong><\/p>\n<p><strong>\u4e00\uff0c\u63cf\u8ff0\u4e00\u4e0bHTML5\u7684\u65b0\u7279\u6027\u4ee5\u53ca\u65b0\u589e\u4e86\u90a3\u4e9b\u8bed\u4e49\u5316\u6807\u7b7e<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\n1\uff1a\u65b0\u7684\u6587\u6863\u7c7b\u578b\uff08&lt;!DOCTYPE html&gt;,\u5373\u65f6\u6d4f\u89c8\u5668\u4e0d\u61c2\u8fd9\u53e5\u8bdd\uff0c\u4e5f\u4f1a\u53bb\u6e32\u67d3\u3002<br \/>\n2\uff1afigure\u5143\u7d20\uff0c\u8bed\u4e49\u5316\u7684\u6807\u7b7e\uff0c<br \/>\n3: \u91cd\u65b0\u5b9a\u4e49\u7684&lt;small&gt;\u7528\u6765\u5b9a\u4e49\u5c0f\u7684\u6392\u7248<br \/>\n4\uff1a\u53bb\u6389link\u548cscript\u6807\u7b7e\u91cc\u8fb9\u7684type\u5c5e\u6027<br \/>\n5\uff1a\u8ba9div\u6210\u4e3a\u53ef\u7f16\u8f91\u5c5e\u6027\u53ea\u9700\u8981\u52a0\u4e00\u4e2a<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7Bcontenteditable%7D\" alt=\"\" data-tag=\"bdshare\" \/>\u5c5e\u6027<br \/>\n6\uff1ahtml5\u7684\u65b0\u5c5e\u6027\u4e2d\u52a0\u5165&lt;input type=email&gt;\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u9a8c\u8bc1\u8fd9\u4e2aemail\u5c5e\u6027<br \/>\n7\uff1aplaceholder\u5c5e\u6027\uff0c\u52a0\u4e0a\u4e0d\u9700\u8981\u5728\u8fdb\u884c\u9a8c\u8bc1\u4e86\u3002\uff08input\u91cc\u8fb9\u7684\u81ea\u5e26\u6587\u5b57\uff0c\u70b9\u8fdb\u53bb\u4e4b\u540e\u4f1a\u81ea\u52a8\u6d88\u5931\uff09\uff1b<br \/>\n8\uff1alocal stroge \u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u5b58\u50a8\u5927\u7684\u6570\u636e\uff0c\u9664\u975e\u4e3b\u52a8\u5220\u9664<\/p>\n<p>\u25cf\u3000<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7B%E6%96%B0%E5%A2%9E%E7%9A%84%E8%AF%AD%E4%B9%89%E5%8C%96%E6%A0%87%E7%AD%BE%7D\" alt=\"\" data-tag=\"bdshare\" \/><\/p>\n<blockquote><p>&lt; title&gt;&lt;\/title&gt;\uff1a\u7b80\u77ed\u3001\u63cf\u8ff0\u6027\u3001\u552f\u4e00\uff08\u63d0\u5347\u641c\u7d22\u5f15\u64ce\u6392\u540d\uff09\u3002<\/p>\n<p>&lt;header&gt;&lt;\/header&gt;\uff1a\u9875\u7709\u901a\u5e38\u5305\u62ec\u7f51\u7ad9\u6807\u5fd7\u3001\u4e3b\u5bfc\u822a\u3001\u5168\u7ad9\u94fe\u63a5\u4ee5\u53ca\u641c\u7d22\u6846<\/p>\n<p>&lt;nav&gt;&lt;\/nav&gt;\uff1a\u6807\u8bb0\u5bfc\u822a\uff0c\u4ec5\u5bf9\u6587\u6863\u4e2d\u91cd\u8981\u7684\u94fe\u63a5\u7fa4\u4f7f\u7528\u3002<\/p>\n<p>&lt;main&gt;&lt;\/main&gt;\uff1a\u9875\u9762\u4e3b\u8981\u5185\u5bb9\uff0c\u4e00\u4e2a\u9875\u9762\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21\u3002\u5982\u679c\u662fweb\u5e94\u7528\uff0c\u5219\u5305\u56f4\u5176\u4e3b\u8981\u529f\u80fd\u3002<\/p>\n<p>&lt;article&gt;&lt;\/article&gt;\uff1a\u5305\u542b\u50cf\u62a5\u7eb8\u4e00\u6837\u7684\u5185\u5bb9= =||\u662f\u8fd9\u4e48\u7406\u89e3\u7684\uff0c\u8868\u793a\u6587\u6863\u3001\u9875\u9762\u3001\u5e94\u7528\u6216\u4e00\u4e2a\u72ec\u7acb\u7684\u5bb9\u5668\u3002<\/p>\n<p>&lt;section&gt;&lt;\/section&gt;\uff1a\u5177\u6709\u76f8\u4f3c\u4e3b\u9898\u7684\u4e00\u7ec4\u5185\u5bb9\uff0c\u6bd4\u5982\u7f51\u7ad9\u7684\u4e3b\u9875\u53ef\u4ee5\u5206\u6210\u4ecb\u7ecd\u3001\u65b0\u95fb\u6761\u76ee\u3001\u8054\u7cfb\u4fe1\u606f\u7b49\u6761<\/p>\n<p>&lt;aside&gt;&lt;\/aside&gt;\uff1a\u6307\u5b9a\u9644\u6ce8\u680f\uff0c\u5305\u62ec\u5f15\u8ff0\u3001\u4fa7\u680f\u3001\u6307\u5411\u6587\u7ae0\u7684\u4e00\u7ec4\u94fe\u63a5\u3001\u5e7f\u544a\u3001\u53cb\u60c5\u94fe\u63a5\u3001\u76f8\u5173\u4ea7\u54c1\u5217\u8868<\/p>\n<p>&lt;footer&gt;&lt;\/footer&gt;\uff1a\u9875\u811a\uff0c\u53ea\u6709\u5f53\u7236\u7ea7\u662fbody\u65f6\uff0c\u624d\u662f\u6574\u4e2a\u9875\u9762\u7684\u9875\u811a\u3002<\/p>\n<p>&lt;small&gt;&lt;\/small&gt;\uff1a\u6307\u5b9a\u7ec6\u5219\uff0c\u8f93\u5165\u514d\u8d23\u58f0\u660e\u3001\u6ce8\u89e3\u3001\u7f72\u540d\u3001\u7248\u6743\u3002<\/p>\n<p>&lt;strong&gt;&lt;\/strong&gt;\uff1a\u8868\u793a\u5185\u5bb9\u91cd\u8981\u6027<\/p>\n<p>&lt;mark&gt;&lt;\/mark&gt;\uff1a\u7a81\u51fa\u663e\u793a\u6587\u672c\uff08yellow\uff09\uff0c\u63d0\u9192\u8bfb\u8005<\/p>\n<p>&lt;cite&gt;&lt;\/cite&gt;\uff1a\u6307\u660e\u5f15\u7528\u6216\u8005\u53c2\u8003\uff0c\u5982\u56fe\u4e66\u7684\u6807\u9898\uff0c\u6b4c\u66f2\u3001\u7535\u5f71\u3001\u7b49\u7684\u540d\u79f0\uff0c\u6f14\u5531\u4f1a<\/p>\n<p>&lt;video&gt;\u5b9a\u4e49\u89c6\u9891\u3002(\u5185\u5d4c\u5143\u7d20)<\/p>\n<p>\u793a\u4f8b\uff1a<\/p>\n<p>&lt;video width=&#8221;320&#8243; height=&#8221;240&#8243; &gt;<\/p>\n<p>&lt;source src=&#8221;movie.ogg&#8221; type=&#8221;video\/ogg&#8221; \/&gt;<\/p>\n<p>Your browser does not support the video tag.<\/p>\n<p>&lt;\/video&gt;<\/p>\n<p>&lt;audio&gt;\u5b9a\u4e49\u58f0\u97f3\u5185\u5bb9\u3002(\u5185\u5d4c\u5143\u7d20)<\/p>\n<p>&lt;mark&gt; \u6807\u7b7e\u5b9a\u4e49\u5e26\u6709\u8bb0\u53f7\u7684\u6587\u672c<\/p><\/blockquote>\n<p><strong>\u4e8c\uff0cHTML5\u672c\u5730\u5b58\u50a8\u6709\u54ea\u4e9b\u65b9\u5f0f\uff1f\u63cf\u8ff0\u4e00\u4e0b\u4ed6\u4eec\u7684\u5f02\u540c\u70b9\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000\u76f8\u540c\u70b9\uff1a<br \/>\n\u90fd\u662f\u4fdd\u5b58\u5728\u6d4f\u89c8\u5668\u7aef\u7684\u4e14\u540c\u6e90\u7684\u3002<\/p>\n<p>\u25cf\u3000\u4e0d\u540c\u70b9\uff1a<br \/>\n\uff081\uff09cookie\u6570\u636e\u59cb\u7ec8\u5728\u540c\u6e90\u7684http\u8bf7\u6c42\u5934\u4e2d\u643a\u5e26\uff0ccookie\u5728\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u6765\u56de\u4f20\u9012\uff0ccookie\u53ef\u4ee5\u9650\u5236\u4fdd\u5b58\u5728\u67d0\u4e2a\u8def\u5f84\u4e0b\uff0csessionstorage\u548clocalstorage\u4e0d\u4f1a\u81ea\u52a8\u628a\u6570\u636e\u53d1\u9001\u7ed9\u670d\u52a1\u5668\uff0c\u4ec5\u5728\u672c\u5730\u4fdd\u5b58\u3002cookie\u662f\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u4f20\u9012\u6570\u636e\u7684\u5a92\u4ecb\u3002<br \/>\n\uff082\uff09\u5b58\u50a8\u5927\u5c0f\u4e0d\u540c cookie\u6570\u636e\u5b58\u50a8\u4e3a4k\uff0csessionstorage\u548clocalstorage\u53ef\u4ee5\u8fbe\u52305m\u751a\u81f3\u66f4\u5927\u3002<br \/>\n\uff083\uff09\u6570\u636e\u6709\u6548\u671f\u4e0d\u540c\uff0csessionstorage\u4ec5\u5728\u5f53\u524d\u6d4f\u89c8\u5668\u5173\u95ed\u524d\u6709\u6548\uff0clocalstorage\u59cb\u7ec8\u6709\u6548\uff0ccookie\u4ec5\u5728\u8bbe\u7f6e\u7684\u8fc7\u671f\u65f6\u95f4\u524d\u6709\u6548\u3002<br \/>\n\uff084\uff09\u4f5c\u7528\u57df\u4e0d\u540c\uff1asessionstorage\u4e0d\u5728\u4e0d\u540c\u7684\u6d4f\u89c8\u5668\u7a97\u53e3\u4e2d\u5171\u4eab\uff0c\u5373\u4f7f\u662f\u540c\u4e00\u4e2a\u754c\u9762\uff0clocalstorage\u548ccookie\u5728\u540c\u6e90\u7a97\u53e3\u4e2d\u90fd\u662f\u5171\u4eab\u7684<\/p>\n<p>****<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7BCOOKIE%E7%9A%84%E5%A2%9E%E5%88%A0%E8%AF%A5%E6%9F%A5%7D\" alt=\"\" data-tag=\"bdshare\" \/><\/p>\n<pre class=\"brush:js;toolbar:false\">\u8bbe\u7f6ecookie\r\n  function setCookie(name,value,days){    \/\/\u5c01\u88c5\u4e00\u4e2a\u8bbe\u7f6ecookie\u7684\u51fd\u6570\r\n        var oDate=new Date();\r\n        oDate.setDate(oDate.getDate()+days);   \/\/days\u4e3a\u4fdd\u5b58\u65f6\u95f4\u957f\u5ea6\r\n        document.cookie=name+'='+value+';expires='+oDate;\r\n    }\r\n    setCookie('password','12345','14');     \/\/\u4fdd\u5b58\u5bc6\u7801,14\u5929\u540e\u8fc7\u671f\r\n\u83b7\u53d6cookie\r\n function getCookie(name){\r\n        var arr=document.cookie.split(';');\r\n        for(var i=0;i&lt;arr.length;i++){\r\n            var arr2=arr[i].split('=');\r\n            if(arr2[0]==name){\r\n                return arr2[1];  \/\/\u627e\u5230\u6240\u9700\u8981\u7684\u4fe1\u606f\u8fd4\u56de\u51fa\u6765\r\n            }\r\n        }\r\n        return '';        \/\/\u627e\u4e0d\u5230\u5c31\u8fd4\u56de\u7a7a\u5b57\u7b26\u4e32\r\n    }\r\ngetCookie(password);\r\n\u5220\u9664COOKIE\r\n    function removeCookie(name){\r\n        setCookie(name,1,-1);    \/\/-1\u8868\u793a\u6628\u5929\u8fc7\u671f,\u7cfb\u7edf\u81ea\u52a8\u5220\u9664   \r\n        \/\/\u5c06\u65e5\u671f\u8bbe\u7f6e\u4e3a\u8fc7\u53bb\r\n    }\r\n\u4fee\u6539cookie \r\ndocument.cookie=\"password=88\";<\/pre>\n<p>****<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7BsessionStorage%E7%9A%84%E5%A2%9E%E5%88%A0%E8%AF%A5%E6%9F%A5%7D\" alt=\"\" data-tag=\"bdshare\" \/><\/p>\n<pre class=\"brush:js;toolbar:false\">\u8bbe\u7f6esessionStorage\u6216\u8005localStoragewindow.sessionStorage.setItem(\"strogeIndexcodes\", \"1234567\");\r\n\u83b7\u53d6sessionStoragelet contrastLists = window.sessionStorage.getItem(\"strogeIndexcodes\");\r\n\u5220\u9664sessionStoragelet contrastLists = window.sessionStorage.removeItem(\"strogeIndexcodes\");\r\nlocalStorage.clear();\/\/\u6e05\u7a7alocalStorage\u4e2d\u6240\u6709\u4fe1\u606f<\/pre>\n<p><strong>\u4e09\uff0c\u5bf9HTNL5\u8bed\u4e49\u5316\u7684\u7406\u89e3\uff1f<\/strong><\/p>\n<p>\u25cf\u3000\u4ec0\u4e48\u662fHTML\u8bed\u4e49\u5316\uff1f<\/p>\n<p>\u6839\u636e\u5185\u5bb9\u7684\u7ed3\u6784\u5316\uff08\u5185\u5bb9\u8bed\u4e49\u5316\uff09\uff0c\u9009\u62e9\u5408\u9002\u7684\u6807\u7b7e\uff08\u4ee3\u7801\u8bed\u4e49\u5316\uff09\u4fbf\u4e8e\u5f00\u53d1\u8005\u9605\u8bfb\u548c\u5199\u51fa\u66f4\u4f18\u96c5\u7684\u4ee3\u7801\u7684\u540c\u65f6\u8ba9\u6d4f\u89c8\u5668\u7684\u722c\u866b\u548c\u673a\u5668\u5f88\u597d\u5730\u89e3\u6790\u3002<\/p>\n<p>\u25cf\u3000\u4e3a\u4ec0\u4e48\u8981\u8bed\u4e49\u5316\uff1f<\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\uff081\uff09html\u8bed\u4e49\u5316\u8ba9\u9875\u9762\u5185\u5bb9\u7ed3\u6784\u66f4\u52a0\u6e05\u6670\uff0c\u4fbf\u4e8e\u6d4f\u89c8\u5668\u641c\u7d22\u5f15\u64ce\u89e3\u6790\uff0c\u66f4\u5bb9\u6613\u9605\u8bfb\uff1b<br \/>\n\uff082\uff09\u5229\u4e8e\u641c\u7d22\u5f15\u64ce\u7684\u722c\u866b\uff0c\u5229\u4e8eSEO\uff1b<br \/>\n\uff083\uff09\u4f7f\u9605\u8bfb\u6e90\u7801\u7684\u4eba\u5bf9\u7f51\u7ad9\u66f4\u5bb9\u6613\u5c06\u7f51\u7ad9\u5206\u5757\uff0c\u4fbf\u4e8e\u9605\u8bfb\u7ef4\u62a4\u7406\u89e3\uff1b<br \/>\n\uff084\uff09\u4fbf\u4e8e\u56e2\u961f\u5f00\u53d1\u548c\u7ef4\u62a4\uff0c\u8bed\u4e49\u5316\u66f4\u5177\u53ef\u8bfb\u6027\uff0c\u662f\u4e0b\u4e00\u6b65\u5427\u7f51\u9875\u7684\u91cd\u8981\u52a8\u5411\uff0c\u9075\u5faaW3C\u6807\u51c6\u7684\u56e2\u961f\u90fd\u9075\u5faa\u8fd9\u4e2a\u6807\u51c6\uff0c\u53ef\u4ee5\u51cf\u5c11\u5dee\u5f02\u5316\u3002<\/p>\n<p><strong>\u56db\uff0c\u4ec0\u4e48\u53eb\u4f18\u96c5\u964d\u7ea7\u548c\u6e10\u8fdb\u589e\u5f3a?<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\uff081\uff09\u6e10\u8fdb\u589e\u5f3a progressive enhancement\uff1a\u9488\u5bf9\u4f4e\u7248\u672c\u6d4f\u89c8\u5668\u8fdb\u884c\u6784\u5efa\u9875\u9762\uff0c\u4fdd\u8bc1\u6700\u57fa\u672c\u7684\u529f\u80fd\uff0c\u7136\u540e\u518d\u9488\u5bf9\u9ad8\u7ea7\u6d4f\u89c8\u5668\u8fdb\u884c\u6548\u679c\u3001\u4ea4\u4e92\u7b49\u6539\u8fdb\u548c\u8ffd\u52a0\u529f\u80fd\u8fbe\u5230\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<p>\uff082\uff09\u4f18\u96c5\u964d\u7ea7 graceful degradation\uff1a\u4e00\u5f00\u59cb\u5c31\u6784\u5efa\u5b8c\u6574\u7684\u529f\u80fd\uff0c\u7136\u540e\u518d\u9488\u5bf9\u4f4e\u7248\u672c\u6d4f\u89c8\u5668\u8fdb\u884c\u517c\u5bb9\u3002<\/p>\n<p><strong>\u4e94\uff0cCSS3\u6587\u672c\u6548\u679c<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<pre class=\"brush:css;toolbar:false\">1)\u3001text-shadow  \u6587\u672c\u9634\u5f71\r\ntext-shadow: 5px 5px 5px #FF0000;\r\n2)\u3001box-shadow  \u76d2\u5b50\u9634\u5f71\r\nbox-shadow: 10px 10px 5px #888888;\r\n3)\u3001text-overflow  \u6587\u672c\u6ea2\u51fa\r\nwhite-space: nowrap; \r\nwidth: 200px; \r\noverflow: hidden;\r\ntext-overflow: ellipsis; \r\n4)word-wrap   \u6362\u884c\r\nword-wrap:break-word;\r\n5)word-break  \u5355\u8bcd\u62c6\u5206\u6362\u884c\r\n  word-break: break-all;<\/pre>\n<p><strong>\u5173\u952e\u70b9\u4e09\uff1ajavaScript\u548cJquery<\/strong><\/p>\n<p><strong>\u4e00\uff0cjavascript\u7684\u6570\u636e\u7c7b\u578b<\/strong><\/p>\n<pre class=\"brush:js;toolbar:false\">\u57fa\u7840\u7684\u6570\u636e\u7c7b\u578b\uff1a\r\n   1\u3001\u5b57\u7b26\u4e32\uff08string\uff09\r\n   2\u3001 \u6570\u5b57\uff08number\uff09\r\n   3\u3001\u5e03\u5c14  boolean\r\n   4\u3001\u6570\u7ec4(array)\r\n   5\u3001null\r\n   6\u3001undefined\uff09\r\n\u590d\u5408\u7684\u6570\u636e\u7c7b\u578b\uff1a\r\n   1\u3001object\u5bf9\u8c61\r\n   2\u3001function  \u6784\u9020\u51fd\u6570\r\n   3\u3001array\u6570\u7ec4<\/pre>\n<p><strong>\u4e8c\uff0c\u4ec0\u4e48\u662fwindow\u5bf9\u8c61\uff1f\u4ec0\u4e48\u662fdocument\u5bf9\u8c61\uff1f<\/strong><\/p>\n<p>\u7b54\u6848:<\/p>\n<p>\u25cf\u3000window\u5bf9\u8c61\u662f\u6307\u6d4f\u89c8\u5668\u6253\u5f00\u7684\u7a97\u53e3\u3002<\/p>\n<p>\u25cf\u3000document\u5bf9\u8c61\u662fDocument\u5bf9\u8c61\uff08HTML \u6587\u6863\u5bf9\u8c61\uff09\u7684\u4e00\u4e2a\u53ea\u8bfb\u5f15\u7528\uff0cwindow\u5bf9\u8c61\u7684\u4e00\u4e2a\u5c5e\u6027\u3002<\/p>\n<p><strong>\u4e09\uff0c\u8bf7\u7b80\u8ff0call\u548capply\u7684\u533a\u522b<\/strong><\/p>\n<p>\u7b54\u6848<\/p>\n<p>\u25cf\u3000call(), \u8c03\u7528\u4e00\u4e2a\u5bf9\u8c61\u7684\u4e00\u4e2a\u65b9\u6cd5\u4ee5\u53e6\u4e00\u4e2a\u5bf9\u8c61\u66ff\u6362\u5f53\u524d\u5bf9\u8c61\u3002<\/p>\n<p>\u25cf\u3000apply(),\u5e94\u7528\u67d0\u4e00\u4e2a\u5bf9\u8c61\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0c\u7528\u53e6\u4e00\u4e2a\u5bf9\u8c61\u66ff\u6362\u5f53\u524d\u5bf9\u8c61\uff08\u7ee7\u627f\u6027\uff09<\/p>\n<p><strong>\u56db\uff0cdocument.load\u548cdocument.ready\u7684\u533a\u522b\u3002<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000document.load\u5728\u6240\u6709\u7684\u8d44\u6e90\u5168\u90e8\u52a0\u8f7d\u5b8c\u6210\u540e\uff0c\u6267\u884c\u4e0b\u4e00\u4e2a\u51fd\u6570\uff08\u4f1a\u6709\u5361\u987f\uff09\u3002<\/p>\n<p>\u25cf\u3000document.ready\u53ea\u8981\u52a0\u8f7d\u5b8cdom\u6811\u5c31\u6267\u884c\u51fd\u6570\uff08\u52a0\u8f7d\u6bd4\u8f83\u5feb\uff09\u3002<\/p>\n<p><strong>\u4e94\uff0cJS\u5982\u4f55\u963b\u6b62\u4e8b\u4ef6\u5192\u6ce1\u548c\u963b\u6b62\u9ed8\u8ba4\u4e8b\u4ef6\u3002<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000event.stoppropagation()\u963b\u6b62\u4e8b\u4ef6\u5192\u6ce1\uff1b<\/p>\n<p>\u25cf\u3000event.preventdefault()\u963b\u6b62\u9ed8\u8ba4\u4e8b\u4ef6\u3002<\/p>\n<blockquote><p>\u5728\u8fd9\u63d2\u64ad\u4e00\u4e2a\u4e8b\u4ef6\u6355\u83b7OR\u4e8b\u4ef6\u5192\u6ce1<\/p><\/blockquote>\n<p>\u25cf\u3000\u4e8b\u4ef6\u6355\u83b7\u6307\u7684\u662f\u4ecedocument\u5230\u89e6\u53d1\u4e8b\u4ef6\u7684\u90a3\u4e2a\u8282\u70b9\uff0c\u5373\u81ea\u4e0a\u800c\u4e0b\u7684\u53bb\u89e6\u53d1\u4e8b\u4ef6\u3002<\/p>\n<p>\u25cf\u3000\u76f8\u53cd\u7684\uff0c\u4e8b\u4ef6\u5192\u6ce1\u662f\u81ea\u4e0b\u800c\u4e0a\u7684\u53bb\u89e6\u53d1\u4e8b\u4ef6<\/p>\n<p>\u25cf\u3000\u7ed1\u5b9a\u4e8b\u4ef6\u65b9\u6cd5\u7684\u7b2c\u4e09\u4e2a\u53c2\u6570\uff0c\u5c31\u662f\u63a7\u5236\u4e8b\u4ef6\u89e6\u53d1\u987a\u5e8f\u662f\u5426\u4e3a\u4e8b\u4ef6\u6355\u83b7\u3002<\/p>\n<p>true,\u4e8b\u4ef6\u6355\u83b7\uff1b<\/p>\n<p>false,\u4e8b\u4ef6\u5192\u6ce1\u3002<\/p>\n<p>\u9ed8\u8ba4false,\u5373\u4e8b\u4ef6\u5192\u6ce1\u3002<\/p>\n<p>\u770b\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre class=\"brush:js;toolbar:false\">document.getElementById(\"parent\").addEventListener(\"click\",function(e){\r\n        alert(\"parent\u4e8b\u4ef6\u88ab\u89e6\u53d1\uff0c\"+e.target.id);\r\n },true)            \r\ndocument.getElementById(\"child\").addEventListener(\"click\",function(e){\r\n        alert(\"child\u4e8b\u4ef6\u88ab\u89e6\u53d1\uff0c\"+e.target.id)\r\n },true)<\/pre>\n<p>\u8fd9\u6837\u7684\u8bdd\u5c31\u662f\u81ea\u4e0a\u800c\u4e0b\u7684\u89e6\u53d1\u4e8b\u4ef6\u3002<\/p>\n<p><strong>\u516d\uff0cJS \u5bf9\u8c61\u548c\u5b57\u7b26\u4e32\u4e92\u8f6c<\/strong><\/p>\n<p>\u7b54\u6848:<\/p>\n<pre class=\"brush:js;toolbar:false\">JSON.stringify()\u7528\u4e8e\u4ece\u4e00\u4e2a\u5bf9\u8c61\u89e3\u6790\u51fa\u5b57\u7b26\u4e32\r\n\u4f8b\u5982\uff1avar a = {a:1,b:2},JSON.stringify(a),\u8f93\u51fa\u2018{\u201ca\u201d\uff1a1\uff0c\u201cb\u201d\uff1a2}\u2019\r\nJSON.parse()\u4ece\u4e00\u4e2ajson\u5b57\u7b26\u4e32\u89e3\u6790\u51fajson\u5bf9\u8c61.\r\nvar str = '{\"name\":\"huangxiaojian\",\"age\":\"23\"}'  \r\njson.parse(str)\u8f93\u51fa\r\n      str = {        \r\n            name:\"huangxiaojian\",        \r\n            age:\"23\"\r\n      }<\/pre>\n<p><strong>\u4e03\uff0cJS splice()\u65b9\u6cd5 \u6216\u8005\u5220\u9664\u6570\u7ec4\u4e2d\u67d0\u4e2a\u503c\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>\u7b54\u6848:<\/p>\n<pre class=\"brush:js;toolbar:false\">\u6570\u7ec4\u4e2d\u7684splice()\u65b9\u6cd5\uff0c\u5220\u9664\u6570\u7ec4\u4e2d\u7684\u67d0\u4e00\u4e2a\u6216\u51e0\u4e2a\u503c\uff0c\r\nsplice(index,length,item),index\u4e3a\u6570\u7ec4\u5f00\u59cb\u7684\u4e0b\u6807\uff0clength\u66ff\u6362\u6216\u5220\u9664\u7684\u957f\u5ea6\uff0citem\u66ff\u6362\u7684\u503c\u3002\r\nitem\u82e5\u4e3a0\u5219\u76f4\u63a5\u5220\u9664\u3002<\/pre>\n<p><strong>\u516b\uff0ceval()\u51fd\u6570\u662f\u505a\u4ec0\u4e48\u7684\uff1f\u6216\u8005\u8bf4\u5982\u4f55\u5c06\u5b57\u7b26\u4e32\u89e3\u6790\u6210js\u5bf9\u8c61\u5e76\u8fd0\u884c\uff1f\uff1f<\/strong><\/p>\n<p>\u7b54\u6848:<\/p>\n<p>\u25cf\u3000\u5b83\u7684\u529f\u80fd\u662f\u628a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u89e3\u6790\u6210JS\u5bf9\u8c61\u5e76\u8fd0\u884c\uff1b<br \/>\n\uff01\uff01\u5e94\u8be5\u907f\u514d\u4f7f\u7528eval\uff0c\u4e0d\u5b89\u5168\uff0c\u975e\u5e38\u8017\u6027\u80fd\uff082\u6b21\uff0c\u4e00\u6b21\u89e3\u6790\u6210js\u8bed\u53e5\uff0c\u4e00\u6b21\u6267\u884c\uff09\u3002<br \/>\n\u7531JSON\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aJSON\u5bf9\u8c61\u7684\u65f6\u5019\u53ef\u4ee5\u7528eval\uff0cvar obj =eval(&#8216;(&#8216;+ str +&#8217;)&#8217;);<\/p>\n<blockquote><p>\u5bf9\u6570\u7ec4\u505a\u64cd\u4f5c\u7684\u4e00\u5199\u65b9\u6cd5<\/p><\/blockquote>\n<p><strong>\u4e5d\uff0c\u8bf7\u7528\u7b80\u5355\u7684\u8bed\u8a00\u63cf\u8ff0\u6570\u7ec4\u65b9\u6cd5pop(),push(),unshift(),shift()<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000pop(),\u5220\u9664\u6570\u7ec4\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u628a\u6570\u7ec4\u957f\u5ea6\u51cf1\uff0c\u5e76\u8fd4\u56de\u5b83\u5220\u9664\u7684\u5143\u7d20\u7684\u503c\uff0c\u5982\u679c\u6570\u7ec4\u4e3a\u7a7a\uff0c\u5219POP\u4e0d\u6539\u53d8\u6570\u7ec4\uff0c\u5e76\u8fd4\u56deundefined\u503c<\/p>\n<p>\u25cf\u3000push(),\u5411\u6570\u7ec4\u7684\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u6216\u591a\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u65b0\u7684\u957f\u5ea6<\/p>\n<p>\u25cf\u3000unshift(),\u5411\u6570\u7ec4\u7684\u5f00\u5934\u6dfb\u52a0\u4e00\u4e2a\u6216\u591a\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u65b0\u7684\u957f\u5ea6<\/p>\n<p>\u25cf\u3000shift()\u65b9\u6cd5\uff0c\u5c06\u6570\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4ece\u5176\u4e2d\u5220\u9664\uff0c\u5e76\u8fd4\u56de\u65b0\u7684\u957f\u5ea6<\/p>\n<p><strong>\u5341\uff0c\u6570\u7ec4\u7684\u622a\u53d6\u548c\u5408\u5e76<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000array.slice(start, [end]);&#8211;&gt;\u622a\u53d6\u4ecestart\u4e4b\u540e\u4e0d\u5305\u62ecend\u7684\u5143\u7d20\uff1b<\/p>\n<p>\u25cf\u3000array.concat([item1[, item2[, . . . [,itemN]]]]); &#8211;&gt;\u5408\u5e76\u6570\u7ec4\uff1b<\/p>\n<p>\u4e24\u8005\u90fd\u662f\u8fd4\u56de\u6570\u7ec4\u7684\u62f7\u8d1d\u6570\u7ec4\uff0c\u6ce8\u610f\u662f\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">substring(start,stop)\u65b9\u6cd5\uff1a\r\n\u7528\u4e8e\u63d0\u53d6\u5b57\u7b26\u4e32\u4e2d\u4ecb\u4e8e\u4e24\u4e2a\u5236\u5b9a\u4e0b\u6807\u4e4b\u95f4\u7684\u5b57\u7b26.  \u5305\u62ecstart\u51fa\u7684\u5b57\u7b26\uff0c\u4f46\u662f\u4e0d\u5305\u62ecstop\u5904\u7684\u5b57\u7b26\u3002\r\nsubstr()\r\n\u7528\u4e8e\u8fd4\u56de\u4e00\u4e2a\u4ece\u6307\u5b9a\u4f4d\u7f6e\u5f00\u59cb\u7684\u6307\u5b9a\u957f\u5ea6\u7684\u5b50\u5b57\u7b26\u4e32\u3002substr(start,length).<\/pre>\n<p><strong>\u5341\u4e00\uff0c\u6570\u7ec4\u5143\u7d20\u7684\u6392\u5e8f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\narray.reverse(); \/\/\u65b9\u6cd5\u7528\u4e8e\u98a0\u5012\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u987a\u5e8f\u3002<\/p>\n<p>\u25cf\u3000array.sort(); \/\/\u65b9\u6cd5\u7528\u4e8e\u5bf9\u6570\u7ec4\u7684\u5143\u7d20\u8fdb\u884c\u6392\u5e8f\u3002\u8bf7\u6ce8\u610f\uff0c\u6570\u7ec4\u5728\u539f\u6570\u7ec4\u4e0a\u8fdb\u884c\u6392\u5e8f\uff0c\u4e0d\u751f\u6210\u526f\u672c\u3002<br \/>\n\u9ed8\u8ba4\u4e3a\u5347\u5e8f\u3002\u5982\u679c\u8c03\u7528\u8be5\u65b9\u6cd5\u65f6\u6ca1\u6709\u4f7f\u7528\u53c2\u6570\uff0c\u5c06\u6309\u5b57\u6bcd\u987a\u5e8f\u5bf9\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u8fdb\u884c\u6392\u5e8f<br \/>\n\u4ee5\u4e0b\u4f8b\u5b50\u4e3a\u5bf9\u6570\u503c\u7684\u5927\u5c0f\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">function sortNumber(a,b){\r\n     return a - b\r\n}\r\nlet NumberLists = [10,5,30,25,1000,1,6];\r\n\u5982\u679c\u76f4\u63a5\u4f7f\u7528sort\u8fdb\u884c\u6392\u5e8f\u5219\u8f93\u51fa\u7684\u503c\u4e3a\u201c\uff1a[1, 10, 1000, 25, 30, 5, 6]\r\ndocument.write(NumberLists .sort(sortNumber))  \/\/1,5,6,10,25,30,1000<\/pre>\n<p><strong>\u5341\u4e8c\uff0c\u6570\u7ec4\u5143\u7d20\u7684\u5b57\u7b26\u4e32\u5316<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>arrayObj.join(separator); \/\/\u8fd4\u56de\u5b57\u7b26\u4e32\uff0c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u5c06\u6570\u7ec4\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u503c\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u4e2d\u95f4\u7528 separator \u9694\u5f00\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">let NumberLists = [10,5,30,25,1000,1,6];\r\nNumberLists.join(\",\");   \/\/\u8f93\u51fa\u7ed3\u679c    \"10,5,30,25,1000,1,6\"<\/pre>\n<p><strong>\u5341\u4e09\uff0c\u5c06\u5b57\u7b26\u4e32\u5206\u5272\u6210\u6570\u7ec4<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>split()\u65b9\u6cd5\uff0c\u7528\u4e8e\u628a\u4e00\u4e2a\u5b57\u7b26\u4e32\u5206\u5272\u6210\u6570\u7ec4\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">split(\"s\",\"d\"),\r\ns\u4ee3\u8868\u5b57\u7b26\u4e32\u6216\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4ece\u8be5\u53c2\u6570\u6307\u5b9a\u7684\u5730\u65b9\u5206\u5272\u3002  \r\nd\u4ee3\u8868\u8fd4\u56de\u7684\u6570\u7ec4\u7684\u6700\u5927\u957f\u5ea6\uff0c\u8fd4\u56de\u7684\u957f\u5ea6\u4e0d\u4f1a\u591a\u4f59\u8fd9\u4e2a\u503c\u5f97\u957f\u5ea6\r\n\u770b\u4f8b\u5b50\uff1a\r\nvar str=\"How are you doing today?\"str.split(\" \")\r\n[\"How\", \"are\", \"you\", \"doing\", \"today?\"]<\/pre>\n<p><strong>\u5341\u56db\uff0c\u7f16\u5199\u4e00\u4e2a\u65b9\u6cd5\uff0c\u53bb\u6389\u4e00\u4e2a\u6570\u7ec4\u7684\u91cd\u590d\u5143\u7d20(\u6709\u591a\u79cd\u540e\u671f\u4e0d\u65ad\u66f4\u65b0)<\/strong><\/p>\n<p><strong>\u7b2c\u4e00\u79cd\u65b9\u6cd5\uff1a<\/strong>\/\u4f7f\u7528indexof\uff08\uff09\u5982\u679c\u68c0\u7d22\u5230\u503c\u5219\u8fd4\u56de1\uff0c\u5982\u679c\u68c0\u6d4b\u4e0d\u5230\u5219\u8fd4\u56de-1\uff0c\u7684\u65b9\u6cd5\uff0c\u548cpush\uff08\uff09\u5411\u6570\u7ec4\u7684\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u6216\u591a\u4e2a\u5143\u7d20\u7684\u65b9\u6cd5\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">var arr = [1,1,1,2,2,3,45,45,65,76]\r\n     function quchong(){\r\n           \/\/new\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4\u6765\u5b58\u653e\u53bb\u91cd\u540e\u7684\u6570\u7ec4\r\n           var newarr = [];\r\n         \/\/\u5faa\u73af\u904d\u5386\u9700\u8981\u53bb\u91cd\u7684\u6570\u7ec4\uff0c\u5982\u679c\u6570\u7ec4\u4e2d\u4e2d\u5df2\u6709\u503c\uff0c\u5c31\u7ee7\u7eed\u5faa\u73af\uff0c\u5982\u679c\u6ca1\u6709\u503c\u5c31\u6dfb\u52a0\u5230\u65b0\u7684\u6570\u7ec4\u4e2d\r\n       for(var i = 0;i&lt;arr.length;i++){\r\n               if(newarr.indexOf(arr[i])==-1){\r\n                   newarr.push(arr[i]);   \r\n            }   \r\n     }\r\n       document.write(newarr)\r\n     }\r\n    quchong(arr);<\/pre>\n<p><strong>\u7b2c\u4e8c\u79cd\u65b9\u6cd5<\/strong>\uff1a\u53cc\u91cd\u5faa\u73af\uff0c\u6bcf\u6b21\u6bd4\u8f83\u4e0e\u4ed6\u76f8\u90bb\u7684\u6570\uff0c\u5982\u679c\u6709\u76f8\u7b49\u7684\u5c31\u5220\u9664\u76f8\u7b49\u7684\u90a3\u4e2a\uff0c\u5982\u679c\u4e0d\u76f8\u7b49\u5c31\u7ee7\u7eed\u5faa\u73af\u3002\u4e0d\u505a\u64cd\u4f5c<\/p>\n<pre class=\"brush:js;toolbar:false\">var arr = [1,23,43,54,1,32,43,54,54,32]\r\n       \/\/\u5faa\u73af\u904d\u5386\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u6bcf\u4e00\u4e2a\u6570\u7136\u540e\u4e0e\u4ed6\u76f8\u90bb\u7684\u6570\u505a\u6bd4\u8f83\uff0c\r\n      for (var i = 0; i &lt; arr.length; i++) {\r\n        for (var a = i + 1; a &lt; arr.length; a++) {\r\n          if (arr[i] === arr[a]) {\r\n            arr.splice(i, 1);\r\n            i--;\r\n          }\r\n        }\r\n      }<\/pre>\n<p><strong>\u5341\u4e94\uff0cJS\u521b\u5efa\u51fd\u6570\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\n\uff081\uff09\u58f0\u660e\u51fd\u6570\uff1afunction name(){}<br \/>\n\uff082\uff09\u533f\u540d\u51fd\u6570\uff1afunction(){} \u9996\u5148\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\uff0c\u53d8\u91cf\u662f\u4e00\u4e2a\u6ca1\u6709\u540d\u5b57\u7684\u51fd\u6570<br \/>\n\uff083\uff09 \u5177\u540d\u51fd\u6570\uff1a\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\uff0c\u53d8\u91cf\u65f6\u4e00\u4e2a\u6709\u540d\u7684\u51fd\u6570\uff0cvar a = function bb(){}<br \/>\n\uff084\uff09\u6784\u9020\u51fd\u6570 new function<br \/>\n\uff085\uff09\u7acb\u5373\u51fd\u6570\uff08\u81ea\u52a8\u6267\u884c\u51fd\u6570\uff09 \u6709\u56db\u79cd\u5199\u6cd5\uff1a<\/p>\n<pre class=\"brush:js;toolbar:false\">1\u3001 (function(){})()     \r\n2\u3001 (function(){} ())   \r\n3\u3001   !function(){}()    \r\n4\u3001 void function(\uff09<\/pre>\n<p><strong>\u5341\u516d\uff0chttp\u8bf7\u6c42\u72b6\u6001\u7801\uff1f\u4e5f\u5c31\u662f\u5e38\u89c1\u7684HTTP\u534f\u8bae\u72b6\u6001\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000200 \u8bf7\u6c42\u6210\u529f<\/p>\n<p>\u25cf\u30004\u5f00\u5934\u7684\u662f\u524d\u7aef\uff08\u5ba2\u6237\u7aef\uff09\u7684\u9519\u8bef<br \/>\n400 \u9519\u8bef\u7684\u8bf7\u6c42\uff08bad request\uff09<br \/>\n404 not found \u672a\u627e\u5230 \u9875\u9762\u672a\u54cd\u5e94\uff0c<br \/>\n403\u670d\u52a1\u5668\u4e86\u89e3\u5ba2\u6237\u7684\u8bf7\u6c42\uff0c\u4f46\u662f\u62d2\u7edd\u5904\u7406<\/p>\n<p>\u25cf\u30005\u5f00\u5934\u7684\u4e00\u822c\u662f\u670d\u52a1\u5668\u7684\u4e8b<br \/>\n500\u670d\u52a1\u5668\u5185\u90e8\u9519\u8bef \u4e0d\u80fd\u53d1\u5b8c\u6210\u5ba2\u6237\u7684\u8bf7\u6c42<br \/>\n502 \u670d\u52a1\u5668\u4f5c\u4e3a\u7f51\u5173\u6216\u8005\u4ee3\u7406\u6536\u5230\u4e86\u65e0\u6548\u7684\u54cd\u5e94<br \/>\n503 service unavailable \u670d\u52a1\u4e0d\u53ef\u7528 \u670d\u52a1\u5668\u7531\u4e8e\u7ef4\u62a4\u6216 \u8005\u8d1f\u8f7d\u8fc7\u91cd\u672a\u80fd\u5e94\u7b54\u3002<\/p>\n<p><strong>\u5341\u4e03\uff0c\u7f16\u5199\u4e00\u4e2a\u65b9\u6cd5 \uff0c\u5199\u51fa\u7cfb\u7edf\u65f6\u95f4\uff0c\u5e74\/\u6708\/\u65e5\/\u65f6\/\u5206\/\u79d2\/<\/strong><\/p>\n<p>\u7b54\u6848<\/p>\n<pre class=\"brush:js;toolbar:false\">var time = new Date();  \r\nvar xitongshijian = time.tolocalestring();  \/\/ \u5f97\u5230\u672c\u5730\u7684\u7cfb\u7edf\u65f6\u95f4<\/pre>\n<p><strong>\u5341\u516b\uff0c\u8c08\u8c08\u4f60\u5bf9This\u5bf9\u8c61\u7684\u7406\u89e3\uff1f<\/strong><\/p>\n<p>1\u3001this\u603b\u662f\u6307\u5411\u51fd\u6570\u7684\u76f4\u63a5\u8c03\u7528\u8005\uff08\u800c\u975e\u95f4\u63a5\u8c03\u7528\u8005\uff09\uff1b<br \/>\n2\u3001\u5982\u679c\u6709new\u5173\u952e\u5b57\uff0cthis\u6307\u5411new\u51fa\u6765\u7684\u90a3\u4e2a\u5bf9\u8c61\uff1b<br \/>\n3\u3001\u5728\u4e8b\u4ef6\u4e2d\uff0cthis\u6307\u5411\u89e6\u53d1\u8fd9\u4e2a\u4e8b\u4ef6\u7684\u5bf9\u8c61\uff0c\u7279\u6b8a\u7684\u662f\uff0cIE\u4e2d\u7684attachEvent\u4e2d\u7684this\u603b\u662f\u6307\u5411\u5168\u5c40\u5bf9\u8c61Window\uff1b<\/p>\n<p>\u770b\u770b\u4e0b\u8fb9\u51e0\u4e2a\u4f8b\u5b50\uff0c\u6216\u8bb8\u53ef\u4ee5\u66f4\u597d\u7684\u7406\u89e3this\u5bf9\u8c61<\/p>\n<p>this\u7684\u6307\u5411<\/p>\n<p>\u25cf\u3000this\u8868\u793a\u5f53\u524d\u5bf9\u8c61\uff0cthis\u7684\u6307\u5411\u662f\u6839\u636e\u8c03\u7528\u7684\u4e0a\u4e0b\u6587\u6765\u51b3\u5b9a\u7684\uff0c\u9ed8\u8ba4\u6307\u5411window\u5bf9\u8c61<\/p>\n<p><strong>\u5168\u5c40\u73af\u5883<\/strong><\/p>\n<blockquote><p>\u5168\u5c40\u73af\u5883\u5c31\u662f\u5728&lt;script&gt;&lt;\/script&gt;\u91cc\u9762\uff0c\u8fd9\u91cc\u7684this\u59cb\u7ec8\u6307\u5411\u7684\u662fwindow\u5bf9\u8c61\uff0c<\/p>\n<p>&lt;script&gt;console.log(this)&lt;\/script&gt; \u6307\u5411window\u5bf9\u8c61<\/p><\/blockquote>\n<p><strong>\u5c40\u90e8\u73af\u5883<\/strong><\/p>\n<blockquote><p>\u5728\u5168\u5c40\u4f5c\u7528\u57df\u4e0b\u76f4\u63a5\u8c03\u7528\u51fd\u6570\uff0cthis\u6307\u5411window<\/p>\n<p>&lt;script&gt;<\/p>\n<p>function func(){<\/p>\n<p>console.log(this) ;\/\/this\u6307\u5411\u7684\u8fd8\u662fwindow\u5bf9\u8c61<\/p>\n<p>}<\/p>\n<p>func();<\/p>\n<p>&lt;\/script&gt;<\/p><\/blockquote>\n<p><strong>\u5bf9\u8c61\u51fd\u6570\u8c03\u7528\uff0c\u54ea\u4e2a\u5bf9\u8c61\u8c03\u7528\u5c31\u6307\u5411\u54ea\u4e2a\u5bf9\u8c61<\/strong><\/p>\n<pre class=\"brush:js;toolbar:false\">&lt;input type=\"button\"id=\"btnOK\" value=\"OK\"&gt;\r\n&lt;script&gt;\r\nvarbtnOK=document.getElementById(\"btnOK\");\r\nbtnOK.onclick=function(){\r\nconsole.log(this);\/\/this\u6307\u5411\u7684\u662fbtnOK\u5bf9\u8c61\r\n}\r\n&lt;\/script&gt;<\/pre>\n<p><strong>\u4f7f\u7528 new \u5b9e\u4f8b\u5316\u5bf9\u8c61\uff0c\u5728\u6784\u9020\u51fd\u6570\u4e2d\u7684this\u6307\u5411\u5b9e\u4f8b\u5316\u5bf9\u8c61\u3002<\/strong><\/p>\n<pre class=\"brush:js;toolbar:false\">&lt;script&gt;\r\nvar Show=function(){\r\n    this.myName=\"Mr.Cao\";   \/\/\u8fd9\u91cc\u7684this\u6307\u5411\u7684\u662fobj\u5bf9\u8c61\r\n}\r\nvar obj=new Show();\r\n&lt;\/script&gt;<\/pre>\n<p><strong>\u4f7f\u7528call\u6216apply\u6539\u53d8this\u7684\u6307\u5411<\/strong><\/p>\n<pre class=\"brush:js;toolbar:false\">&lt;script&gt;\r\nvar Go=function(){\r\n     this.address=\"\u6df1\u5733\";\r\n}\r\nvar Show=function(){\r\n     console.log(this.address);\/\/\u8f93\u51fa \u6df1\u5733\r\n}\r\nvar go=new Go();\r\nShow.call(go);\/\/\u6539\u53d8Show\u65b9\u6cd5\u7684this\u6307\u5411go\u5bf9\u8c61\r\n&lt;\/script&gt;<\/pre>\n<p><strong>\u5341\u4e5d\uff0c\u8bf7\u7528js\u5199\u4e00\u4e2a\u5224\u65ad\u67d0\u4e2a\u5b57\u7b26\u5728\u8be5\u5b57\u7b26\u4e32\u4e2d\u51fa\u73b0\u4e86\u51e0\u6b21\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<pre class=\"brush:js;toolbar:false\">\/\/\u7ecf\u6d4b\u8bd5\u597d\u4f7f\u3002\r\n&lt;script&gt;\r\nvar a = \"jhdoiwejesdds\";\r\nvar n = (a.split('j')).length-1;\r\nconsole.log(n);\r\n&lt;\/script&gt;<\/pre>\n<blockquote><p>about at Ajax , HTTP\u534f\u8bae<\/p><\/blockquote>\n<p><strong>\u4e00\uff0c.Ajax \u662f\u4ec0\u4e48? Ajax\u7684\u5de5\u4f5c\u539f\u7406\u662f\u4ec0\u4e48\uff1fAjax\u7684\u4f18\u7f3a\u70b9\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000Ajax\u5176\u6838\u5fc3\u6709 JavaScript\u3001XMLHTTPRequest\u3001DOM\u5bf9\u8c61\u7ec4\u6210\uff0c\u901a\u8fc7XmlHttpRequest\u5bf9\u8c61\u6765\u5411\u670d\u52a1\u5668\u53d1\u5f02\u6b65\u8bf7\u6c42\uff0c\u4ece\u670d\u52a1\u5668\u83b7\u5f97\u6570\u636e\u3002\u662f\u4e00\u79cd\u521b\u5efa\u4ea4\u4e92\u5f0f\u7f51\u9875\u5e94\u7528\u7684\u7f51\u9875\u5f00\u53d1\u6280\u672f\u3002<br \/>\n\uff081\uff09\u4f7f\u7528XMLHttpRequest\u5bf9\u8c61\u4e0eWeb\u670d\u52a1\u5668\u8fdb\u884c\u5f02\u6b65\u6570\u636e\u901a\u4fe1\u3002<br \/>\n\uff082\uff09\u4f7f\u7528Javascript\u64cd\u4f5cDocument Object Model\u8fdb\u884c\u52a8\u6001\u663e\u793a\u53ca\u4ea4\u4e92\u3002<br \/>\n\uff083\uff09\u4f7f\u7528JavaScript\u7ed1\u5b9a\u548c\u5904\u7406\u6240\u6709\u6570\u636e\u3002<\/p>\n<p>\u25cf\u3000Ajax\u7684\u5de5\u4f5c\u539f\u7406\u76f8\u5f53\u4e8e\u5728\u7528\u6237\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u52a0\u4e86\u2014\u4e2a\u4e2d\u95f4\u5c42(AJAX\u5f15\u64ce),\u4f7f\u7528\u6237\u64cd\u4f5c\u4e0e\u670d\u52a1\u5668\u54cd\u5e94\u5f02\u6b65\u5316\u3002\u5e76\u4e0d\u662f\u6240\u6709\u7684\u7528\u6237\u8bf7\u6c42\u90fd\u63d0\u4ea4\u7ed9\u670d\u52a1\u5668,\u50cf\u2014\u4e9b\u6570\u636e\u9a8c\u8bc1\u548c\u6570\u636e\u5904\u7406\u7b49\u90fd\u4ea4\u7ed9 Ajax\u5f15\u64ce\u81ea\u5df1\u6765\u505a, \u53ea\u6709\u786e\u5b9a\u9700\u8981\u4ece\u670d\u52a1\u5668\u8bfb\u53d6\u65b0\u6570\u636e\u65f6\u518d\u7531Ajax\u5f15\u64ce\u4ee3\u4e3a\u5411\u670d\u52a1\u5668\u63d0\u4ea4\u8bf7\u6c42\u3002<\/p>\n<blockquote><p>\u4f18\u70b9<\/p>\n<p>\uff081\uff09\u53ef\u4ee5\u5b9e\u73b0\u5f02\u6b65\u901a\u4fe1\u6548\u679c\uff0c\u5b9e\u73b0\u9875\u9762\u5c40\u90e8\u5237\u65b0\uff0c\u5e26\u6765\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\uff1b\u6309\u9700\u83b7\u53d6\u6570\u636e\uff0c\u8282\u7ea6\u5e26\u5bbd\u8d44\u6e90\u3002<\/p>\n<p>\uff082\uff09\u524d\u7aef\u548c\u540e\u7aef\u8d1f\u8f7d\u5e73\u8861<\/p>\n<p>\uff083\uff09\u754c\u9762\u4e0e\u5e94\u7528\u5206\u79bb\u3002<\/p><\/blockquote>\n<blockquote><p>\u7f3a\u70b9<\/p>\n<p>&lt;1&gt;.AJAX\u5e72\u6389\u4e86Back\u548cHistory\u529f\u80fd\uff0c\u5373\u5bf9\u6d4f\u89c8\u5668\u673a\u5236\u7684\u7834\u574f\u3002<\/p>\n<p>&lt;2&gt;.AJAX\u7684\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<p>&lt;3&gt;.\u5bf9\u641c\u7d22\u5f15\u64ce\u652f\u6301\u8f83\u5f31\u3002<\/p>\n<p>&lt;4&gt;.\u7834\u574f\u7a0b\u5e8f\u7684\u5f02\u5e38\u5904\u7406\u673a\u5236\u3002<\/p>\n<p>&lt;5&gt;.\u8fdd\u80ccURL\u548c\u8d44\u6e90\u5b9a\u4f4d\u7684\u521d\u8877\u3002<\/p>\n<p>&lt;6&gt;.AJAX\u4e0d\u80fd\u5f88\u597d\u652f\u6301\u79fb\u52a8\u8bbe\u5907\u3002<\/p>\n<p>&lt;7&gt;.\u5ba2\u6237\u7aef\u8fc7\u80a5\uff0c\u592a\u591a\u5ba2\u6237\u7aef\u4ee3\u7801\u9020\u6210\u5f00\u53d1\u4e0a\u7684\u6210\u672c\u3002<\/p><\/blockquote>\n<p><strong>\u4e8c.\u7b80\u8ff0ajax \u7684\u8fc7\u7a0b\u3002<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\uff081\uff09\u521b\u5efaXMLHttpRequest\u5bf9\u8c61,\u4e5f\u5c31\u662f\u521b\u5efa\u4e00\u4e2a\u5f02\u6b65\u8c03\u7528\u5bf9\u8c61<br \/>\n\uff082\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u7684HTTP\u8bf7\u6c42,\u5e76\u6307\u5b9a\u8be5HTTP\u8bf7\u6c42\u7684\u65b9\u6cd5\u3001URL\u53ca\u9a8c\u8bc1\u4fe1\u606f<br \/>\n\uff083\uff09\u8bbe\u7f6e\u54cd\u5e94HTTP\u8bf7\u6c42\u72b6\u6001\u53d8\u5316\u7684\u51fd\u6570<br \/>\n\uff084\uff09\u53d1\u9001HTTP\u8bf7\u6c42<br \/>\n\uff085\uff09\u83b7\u53d6\u5f02\u6b65\u8c03\u7528\u8fd4\u56de\u7684\u6570\u636e<br \/>\n\uff086\uff09\u4f7f\u7528JavaScript\u548cDOM\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0<\/p>\n<p><strong>\u4e09\uff0c\u8bf7\u7b80\u8ff0ajax\u4e2dget()\u548cpost()\u7684\u533a\u522b<\/strong><\/p>\n<p>\uff081\uff09get\u8bf7\u6c42\uff0c\u53c2\u6570\u4f1a\u663e\u793a\u5728url\u4e2d\uff0c\u5c06\u53c2\u6570\u6dfb\u52a0\u5728\u8bf7\u6c42\u7684url\u8def\u5f84\u540e\u9762\uff0c\u8fdb\u884c\u4f20\u53c2\uff0c\uff08\u53d7url\u7684\u9650\u5236\uff09\u53d1\u9001\u7684\u6570\u636e\u91cf\u5c0f\uff0c\u4f1a\u88ab\u5ba2\u6237\u7aef\u7684\u6d4f\u89c8\u5668\u7f13\u5b58\u8d77\u6765\uff0c\u4f1a\u5e26\u6765\u4e25\u91cd\u7684\u5b89\u5168\u95ee\u9898\uff0c\u4e00\u822c\u5728\u83b7\u53d6\u6570\u636e\u65f6\u4f7f\u7528get\u3002<br \/>\n\uff082\uff09post\u8bf7\u6c42\uff0c\u9700\u8981\u6dfb\u52a0HTTP\u8bf7\u5934\uff0c\u6765\u53d1\u9001\u5230\u670d\u52a1\u5668\uff0c\u4f20\u9001\u5f97\u6570\u636e\u91cf\u5927\uff0c\u4e00\u822c\u5728\u4e0a\u4f20\u6570\u636e\u65f6\u4f7f\u7528post\u3002<\/p>\n<hr \/>\n<p>\u533a\u522b\u4e00\uff1aget\u91cd\u70b9\u5728\u4ece\u670d\u52a1\u5668\u4e0a\u83b7\u53d6\u8d44\u6e90,post\u91cd\u70b9\u5728\u60f3\u670d\u52a1\u5668\u53d1\u9001\u6570\u636e;<\/p>\n<p>\u533a\u522b\u4e8c\uff1aget\u4f20\u8f93\u6570\u636e\u662f\u901a\u8fc7URL\u8bf7\u6c42,\u4ee5filed(\u5b57\u6bb5)=value\u7684\u5f62\u5f0f,\u7f6e\u4e8eURL\u540e,\u5e76\u7528&#8221;?&#8221;\u8fde\u63a5,<\/p>\n<p>\u591a\u4e2a\u8bf7\u6c42\u6570\u636e\u4e4b\u95f4\u7528<br \/>\n&#8220;&amp;&#8221;\u8fde\u63a5,\u5982http:\/\/127.0.0.1\/Test\/login.action?name=admin&amp;password=admin\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u7528\u6237\u662f\u53ef\u89c1\u7684<\/p>\n<p>\u533a\u522b\u4e09\uff1aget\u4f20\u8f93\u91cf\u5c0f,\u56e0\u4e3a\u53d7URL\u957f\u5ea6\u9650\u5236,\u4f46\u6548\u7387\u8f83\u4f4e<br \/>\npost\u53ef\u4ee5\u4f20\u8f93\u5927\u91cf\u6570\u636e,\u6240\u4ee5\u4e0a\u4f20\u6587\u4ef6\u65f6\u53ea\u80fd\u7528post\u65b9\u5f0f<\/p>\n<p>\u533a\u522b\u56db\uff1aget\u662f\u4e0d\u5b89\u5168\u7684,\u56e0\u4e3aURL\u662f\u53ef\u89c1\u7684,\u53ef\u80fd\u4f1a\u6cc4\u9732\u79c1\u5bc6\u4fe1\u606f,\u5982\u5bc6\u7801\u7b49<br \/>\npost\u8f83get\u5b89\u5168<\/p>\n<p><strong>\u56db\uff0c\u4ec0\u4e48\u662fHTTP\u534f\u8bae?<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae(HTTP)\u662f\u4e00\u79cd\u901a\u4fe1\u534f\u8bae\uff0c\u5b83\u5141\u8bb8\u5c06\u8d85\u6587\u672c\u6807\u8bb0\u8bed\u8a00(HTML)\u6587\u6863\u4eceWeb\u670d\u52a1\u5668\u4f20\u9001\u5230\u5ba2\u6237\u7aef\u7684\u6d4f\u89c8\u5668\u3002<\/p>\n<p><strong>\u4e94\uff0c\u8bf7\u8bf4\u4e00\u4e0b\u4ece\u8f93\u5165 URL\u5230\u52a0\u8f7d\u51fa\u9875\u9762\u8fc7\u7a0b\u4e2d\u90fd\u53d1\u751f\u4e86\u4ec0\u4e48\uff1f\uff08\u95ee\u8fd9\u4e2a\u95ee\u9898\u9996\u5148\u4f1a\u8003\u5bdf\u4f60\u5bf9HTTP\u534f\u8bae\u7684\u7406\u89e3\uff0c\u800c\u6765\u77e5\u9053\u4f60\u77e5\u8bc6\u7684\u6df1\u5ea6\u4ee5\u53ca\u6269\u5c55\u9762\uff09<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000step1,\u8f93\u5165URL\uff0c<\/p>\n<p>\u25cf\u3000step2\uff0c\u6d4f\u89c8\u5668\u67e5\u627e\u57df\u540d\u7684IP\u5730\u5740<\/p>\n<p>\u25cf\u3000step3\uff0c\u67e5\u627e\u5b8c\u6210\u4e4b\u540e\u6d4f\u89c8\u5668\u5411web\u670d\u52a1\u5668\u53d1\u9001\u4e00\u4e2aHTTP\u8bf7\u6c42\uff0c<\/p>\n<p>\u25cf\u3000step4\uff0c\u670d\u52a1\u5668\u7684\u6c38\u4e45\u91cd\u5b9a\u5411\u76f8\u5e94<\/p>\n<p>\u25cf\u3000step5\uff0c\u6d4f\u89c8\u5668\u8ddf\u8e2a\u91cd\u5b9a\u5411\u5730\u5740<\/p>\n<p>\u25cf\u3000step6\uff0c\u670d\u52a1\u5668\u5904\u7406\u8bf7\u6c42<\/p>\n<p>\u25cf\u3000step7\uff0c\u670d\u52a1\u5668\u8fd4\u56de\u4e00\u4e2ahttp\u54cd\u5e94\u3002<\/p>\n<p>\u25cf\u3000step8\uff0c\u6d4f\u89c8\u5668\u663e\u793aHTML<\/p>\n<p>\u25cf\u3000step9,\u6d4f\u89c8\u5668\u53d1\u9001\u5f02\u6b65\u8bf7\u6c42<\/p>\n<p><strong>\u516d\uff0c\u6d4f\u89c8\u5668\u662f\u5982\u4f55\u6e32\u67d3\u9875\u9762\u7684\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000step1,\u89e3\u6790HTML\u6587\u4ef6\uff0c\u521b\u5efaDOM\u6811\uff08\u81ea\u4e0a\u800c\u4e0b\u7684\u521b\u5efa\uff09\uff0c<\/p>\n<p>\u25cf\u3000step2\uff0c\u89e3\u6790CSS\uff0c\u89e3\u6790\u7684\u4f18\u5148\u7ea7\uff08\u6d4f\u89c8\u5668\u9ed8\u8ba4&#8211;&lt;link style&gt;&#8211;\u5185\u8054\u6837\u5f0f&lt;style&gt;&lt;\/style&gt;&#8211;\u884c\u5185\u6807\u7b7e\uff09<\/p>\n<p>\u25cf\u3000step3\uff0c\u5c06CSS\u4e0eDOM\u5408\u5e76\uff0c\u6784\u5efa\u6e32\u67d3\u6811\uff0c\uff08Render Tree\uff09<\/p>\n<p>\u25cf\u3000step4,\u5e03\u5c40\u4e0e\u7ed8\u5236\uff0c\u91cd\u7ed8(repaint)\u4e0e\u91cd\u6392\uff08reflow\uff09<\/p>\n<blockquote><p>\u63a5\u4e0b\u6765\u804a\u4e00\u804a\u5e38\u89c1\u7684\u8de8\u57df\u95ee\u9898\u3002<\/p><\/blockquote>\n<p><strong>\u4e00\uff0c\u8bf4\u4e00\u4e0b\u4ec0\u4e48\u662f\u8de8\u57df?\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8de8\u57df\u95ee\u9898\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000\u8de8\u57df\uff0c\u6307\u7684\u662f\u6d4f\u89c8\u5668\u4e0d\u80fd\u6267\u884c\u5176\u4ed6\u7f51\u7ad9\u7684\u811a\u672c.<\/p>\n<p>\u25cf\u3000\u51fa\u73b0\u8de8\u57df\u95ee\u9898\u662f\u56e0\u4e3a\u53d7\u6d4f\u89c8\u5668\u7684\u540c\u6e90\u7b56\u7565\uff08\u4e0b\u8fb9\u4f1a\u6709\u4ecb\u7ecd\uff09\u7684\u5f71\u54cd\uff0c\u662f\u6d4f\u89c8\u5668\u5bf9[JavaScript])\u65bd\u52a0\u7684\u5b89\u5168\u9650\u5236\u3002\u51fa\u73b0\u8de8\u57df\u4e3b\u8981\u662f\u4e3a\u4e86\u7528\u6237\u7684\u4e0a\u7f51\u5b89\u5168\u3002<\/p>\n<p><strong>\u4e8c\uff0c\u4ec0\u4e48\u662f\u540c\u6e90\u7b56\u7565\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<br \/>\n\u6d4f\u89c8\u5668\u53ea\u5141\u8bb8\u8bbf\u95ee\u540c\u4e00\u534f\u8bae\uff0c\u57df\u540d\uff0c\u7aef\u53e3\u76f8\u540c\u7684\u7f51\u9875\u3002<\/p>\n<p><strong>\u4e09\uff0c\u89e3\u51b3\u8de8\u57df\u7684\u51e0\u79cd\u529e\u6cd5\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000CORE\u8de8\u57df\u8d44\u6e90\u5171\u4eabcross-origin-resource-sharing<\/p>\n<p>\u670d\u52a1\u5668\u7aef\u5bf9\u4e8e CORS\u7684\u652f\u6301\uff0c\u4e3b\u8981\u5c31\u662f\u901a\u8fc7\u8bbe\u7f6eAccess-Control-Allow-Origin\u6765\u8fdb\u884c\u7684\u3002\u5982\u679c\u6d4f\u89c8\u5668\u68c0\u6d4b\u5230\u76f8\u5e94\u7684\u8bbe\u7f6e\uff0c\u5c31\u53ef\u4ee5\u5141\u8bb8Ajax\u8fdb\u884c\u8de8\u57df\u7684\u8bbf\u95ee&#8211;\u4e5f\u5c31\u662f\u5e38\u8bf4\u7684\u670d\u52a1\u5668\u52a0\u8bf7\u6c42\u5934\u3002<\/p>\n<p>\u4e0d\u8fc7\u540e\u53f0\u7528\u4e86spring boot \u52a0\u4e00\u4e2a\u6ce8\u89e3\u5c31\u597d\u4e86\u3002\u6846\u67b6\u91cc\u8fb9\u81ea\u5e26\u7684@CrossOrigin<\/p>\n<p>\u25cf\u3000JSONP\u89e3\u51b3\u8de8\u57df<\/p>\n<p>\u539f\u7406\uff1a\u501f\u52a9<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7Bscript%E6%A0%87%E7%AD%BE%E7%9A%84src%E5%B1%9E%E6%80%A7%7D\" alt=\"\" data-tag=\"bdshare\" \/>\u4e0d\u53d7\u540c\u6e90\u7b56\u7565\u7684\u5f71\u54cd\u8fdb\u884c\u6570\u636e\u8bf7\u6c42\u3002\u52a8\u6001\u63d2\u5165script\u6807\u7b7e\uff0c\u901a\u8fc7script\u6807\u7b7e\u5f15\u5165\u4e00\u4e2ajs\u6587\u4ef6\uff0c\u8fd9\u4e2ajs\u6587\u4ef6\u8f7d\u5165\u6210\u529f\u540e\u4f1a\u6267\u884c\u6211\u4eec\u5728url\u53c2\u6570\u4e2d\u6307\u5b9a\u7684\u51fd\u6570\uff0c\u5e76\u4e14\u4f1a\u628a\u6211\u4eec\u9700\u8981\u7684json\u6570\u636e\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165\u3002\u6ce8\u610f\uff0c\u53ea\u652f\u6301GET\u8bf7\u6c42\u4e0d\u8fc7\u517c\u5bb9\u6027\u6bd4\u8f83\u597d\uff0c\u65e0\u6cd5\u5224\u65ad\u8bf7\u6c42\u662f\u5426\u5931\u8d25\uff0c\u5b89\u5168\u6027\u4e0d\u9ad8\u3002<\/p>\n<pre class=\"brush:js;toolbar:false\">\/\/js\u539f\u751f\u5199\u6cd5\u7684JSONP\r\n&lt;script&gt;\r\n    function createJs(sUrl){\r\n        var oScript = document.createElement('script');\r\n        oScript.type = 'text\/javascript';\r\n        oScript.src = sUrl;\r\ndocument.getElementsByTagName('head')[0].appendChild(oScript);\r\n    }\r\n    createJs('jsonp.js');\r\n&lt;\/script&gt;<\/pre>\n<pre class=\"brush:js;toolbar:false\">\/\/Jquery\u7248\u672c\u7684jsonp\r\n $.ajax({\r\n   type:\"get\",\r\n   url:'http:\/\/api.map.baidu.com\/telematics\/v3\/weather?\r\n               output=json&amp;ak=0A5bc3c4fb543c8f9bc54b77bc155724',\r\n   data:{\r\n        location:$(\"#city\").val()||\"\u4e0a\u6d77\"\r\n   },\r\n   dataType:\"jsonp\",\r\n   success: function (data) {\r\n        \/\/\u6e32\u67d3\u6a21\u7248\r\n         var html = template('template',{list:data.results[0].weather_data})\r\n         $('tbody').html(html);\r\n   }\r\n });<\/pre>\n<p>\u73b0\u5728\u884d\u751f\u51fa\u6765\u7684vue-cli\u811a\u624b\u67b6\u9879\u76ee\u91cc\u7684Npm\u6a21\u5757http-proxy-middleware\u4e5f\u53ef\u4ee5\u89e3\u51b3\u8de8\u57df\uff0c\u8be6\u7ec6\u7684\u6559\u7a0b\u8bf7\u770bVue\u9762\u8bd5\u9898\u8be6\u89e3<\/p>\n<blockquote><p>\u518d\u8005\u8c08\u8c08\u7ecf\u5e38\u9047\u5230\u7684<img decoding=\"async\" class=\"medium-zoom-image\" src=\"https:\/\/math.jianshu.com\/math?formula=%5Ccolor%7Bred%7D%7B%E9%97%AD%E5%8C%85%20Closer%7D\" alt=\"\" data-tag=\"bdshare\" \/>\u95ee\u9898\uff0c\u591a\u6570\u60c5\u51b5\u4e0b\u53ea\u662f\u7406\u89e3\u4ed6\u7684\u89e3\u91ca\uff0c\u4f46\u5e76\u672a\u5b9e\u9645\u7406\u89e3\uff0c\u4e5f\u5c31\u662f\u505a\u9898\u505a\u4e0d\u51fa\u6765\uff0c\u81ea\u5df1\u5199\u4e5f\u5199\u4e0d\u597d\u7684\u90a3\u79cd\uff0c\u8fd8\u662f\u9700\u8981\u597d\u597d\u7406\u89e3\u7406\u89e3\u3002<\/p><\/blockquote>\n<p><strong>\u4e00\uff0c\u4ec0\u4e48\u662f\u95ed\u5305\uff1f\u8c08\u8c08\u4f60\u5bf9\u95ed\u5305\u7684\u4e86\u89e3\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000\u95ed\u5305\u662f\u6307\u6709\u6743\u8bbf\u95ee\u53e6\u4e00\u4e2a\u51fd\u6570\u4f5c\u7528\u57df\u4e2d\u53d8\u91cf\u7684\u51fd\u6570\uff0c\u521b\u5efa\u95ed\u5305\u7684\u6700\u5e38\u89c1\u7684\u65b9\u5f0f\u5c31\u662f\u5728\u4e00\u4e2a\u51fd\u6570\u5185\u521b\u5efa\u53e6\u4e00\u4e2a\u51fd\u6570\uff0c\u901a\u8fc7\u53e6\u4e00\u4e2a\u51fd\u6570\u8bbf\u95ee\u8fd9\u4e2a\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf,\u5229\u7528\u95ed\u5305\u53ef\u4ee5\u7a81\u7834\u4f5c\u7528\u94fe\u57df\uff0c\u5c06\u51fd\u6570\u5185\u90e8\u7684\u53d8\u91cf\u548c\u65b9\u6cd5\u4f20\u9012\u5230\u5916\u90e8\u3002<\/p>\n<p>\u25cf\u3000\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u76f4\u63a5\u8bfb\u53d6\u5168\u5c40\u53d8\u91cf\uff0c\u4f46\u5728\u51fd\u6570\u5916\u90e8\u65e0\u6cd5\u8bfb\u53d6\u5230\u5185\u90e8\u7684\u53d8\u91cf\uff0c\uff08\u5b9a\u4e49\u5728\u4e00\u4e2a\u51fd\u6570\u5185\u90e8\u7684\u51fd\u6570\uff09\uff0c\u95ed\u5305\u662f\u53cd\u5783\u573e\u56de\u6536\u673a\u5236\u7684\uff0c\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u4f5c\u7528\u94fe\u57df\uff0c\u95ed\u5305\u7684\u7279\u6027\u662f\u79c1\u6709\u6027\uff0c\u8fd9\u79cd\u7279\u6027\u662f\u95ed\u5305\u5f97\u53d8\u91cf\u5b58\u5728\u5185\u5b58\u4e2d\uff0c\u5185\u5b58\u6d88\u8017\u5f88\u5927\uff0c\u9020\u6210\u7f51\u9875\u6027\u80fd\u95ee\u9898\uff0c\uff08\u5728ie\u4e2d\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\uff09\u5728\u9000\u51fa\u51fd\u6570\u4e4b\u524d\u5c06\u5168\u90e8\u53d8\u91cf\u6e05\u9664\u3002\u79c1\u6709\u5316\u53d8\u91cf<\/p>\n<p>\u56de\u7b54\u91cd\u70b9\u7684\u56db\u53e5\u8bdd\uff1a<\/p>\n<p>1\uff0c\u4f5c\u7528\u94fe\u57df\uff08\u5b50\u5bf9\u8c61\u4e00\u7ea7\u4e00\u7ea7\u5411\u4e0a\u5bfb\u627e\u7236\u5bf9\u8c61\u7684\u53d8\u91cf\uff0c\u7236\u5bf9\u8c61\u7684\u6240\u6709\u53d8\u91cf\u5bf9\u5b50\u5bf9\u8c61\u662f\u53ef\u89c1\u7684\uff0c\u53cd\u4e4b\u4e0d\u6210\u7acb\uff09<\/p>\n<p>2\uff0c\u5783\u573e\u56de\u6536\u673a\u5236\uff08\u8fdd\u80cc\uff09<\/p>\n<p>3\uff0c\u79c1\u6709\u5316\u53d8\u91cf<\/p>\n<p>4\uff0c \u95ed\u5305\u4f1a\u5728\u7236\u51fd\u6570\u5916\u90e8\u6539\u53d8\u7236\u51fd\u6570\u5185\u90e8\u53d8\u91cf\u7684\u503c<\/p>\n<p><strong>\u4e8c\uff0c\u4ec0\u4e48\u662f\u5783\u573e\u56de\u6536\u673a\u5236\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000javascript\u5177\u6709\u81ea\u52a8\u5783\u573e\u56de\u6536\u673a\u5236\uff0c\u6267\u884c\u73af\u5883\u4f1a\u8d1f\u8d23\u7ba1\u7406\u4ee3\u7801\u6267\u884c\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u7684\u5185\u5b58\u3002\u539f\u7406\u5c31\u662f\u627e\u51fa\u90a3\u4e9b\u4e0d\u518d\u7ee7\u7eed\u4f7f\u7528\u7684\u53d8\u91cf\uff0c\u7136\u540e\u91ca\u653e\u5176\u5360\u6709\u5185\u5b58\u3002<\/p>\n<p>\u627e\u51fa\u7a0b\u5e8f\u4e2d\u4e0d\u5728\u4f7f\u7528\u7684\u53d8\u91cf\uff0c\u7136\u540e\u91ca\u653e\u6389\u5176\u5360\u7528\u7684\u5185\u5b58\uff0c\u5783\u573e\u56de\u6536\u673a\u5236\u4f1a\u6309\u7167\u56fa\u5b9a\u7684\u65f6\u95f4\u5468\u671f\u6765\u6267\u884c\u3002\u4e0d\u5728\u4f7f\u7528\u7684\u53d8\u91cf\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\uff08\u751f\u547d\u5468\u671f\u7ed3\u675f\u7684\u53d8\u91cf\uff09\uff0c\u5168\u5c40\u53d8\u91cf\u7684\u751f\u547d\u5468\u671f\u53ea\u6709\u5728\u6d4f\u89c8\u5668\u9875\u9762\u5173\u95ed\u540e\u624d\u4f1a\u7ed3\u675f\u3002<\/p>\n<p>\u25cf\u3000\u5783\u573e\u56de\u6536\u673a\u5236\u7684\u597d\u5904\u548c\u574f\u5904<\/p>\n<p>\u25cb\u3000\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<p>\u25cb\u3000\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<p><strong>\u4e09\uff0cJavascript\u4f5c\u7528\u94fe\u57df?<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u5f53\u9700\u8981\u4ece\u5c40\u90e8\u51fd\u6570\u67e5\u627e\u67d0\u4e00\u5c5e\u6027\u6216\u65b9\u6cd5\u65f6\uff0c\u5982\u679c\u5f53\u524d\u4f5c\u7528\u57df\u6ca1\u6709\u627e\u5230\uff0c\u5c31\u4f1a\u4e0a\u6eaf\u5230\u4e0a\u5c42\u4f5c\u7528\u57df\u67e5\u627e\uff0c\u76f4\u81f3\u5168\u5c40\u51fd\u6570\uff0c\u8fd9\u79cd\u7ec4\u7ec7\u5f62\u5f0f\u5c31\u662f\u4f5c\u7528\u57df\u94fe\u3002<br \/>\n\u5168\u5c40\u51fd\u6570\u65e0\u6cd5\u67e5\u770b\u5c40\u90e8\u51fd\u6570\u7684\u5185\u90e8\u7ec6\u8282\uff0c\u4f46\u5c40\u90e8\u51fd\u6570\u53ef\u4ee5\u67e5\u770b\u5176\u4e0a\u5c42\u7684\u51fd\u6570\u7ec6\u8282\uff0c\u76f4\u81f3\u5168\u5c40\u7ec6\u8282\u3002<\/p>\n<blockquote><p>JS\u9762\u5411\u5bf9\u8c61\uff0c\u521b\u5efa\u5bf9\u8c61\uff0c\u4e8b\u4ef6\u59d4\u6258\uff0c\u539f\u578b\u94fe,\u524d\u7aef\u6027\u80fd\u4f18\u5316\u7b49\u7684\u6709\u5173\u7684\u95ee\u9898<\/p><\/blockquote>\n<p><strong>\u4e00\uff0cJavascript\u9762\u5411\u5bf9\u8c61?<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u4e00\u5207\u4e8b\u7269\u7686\u5bf9\u8c61<br \/>\n\u5bf9\u8c61\u5177\u6709\u5c01\u88c5\u548c\u7ee7\u627f\u7279\u6027<br \/>\nJavaScript \u8bed\u8a00\u662f\u901a\u8fc7\u4e00\u79cd\u53eb\u505a \u539f\u578b\uff08prototype\uff09\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684<br \/>\n\u57fa\u4e8e\u539f\u578b\u7684\u9762\u5411\u5bf9\u8c61\u65b9\u5f0f\u4e2d\uff0c\u5bf9\u8c61\uff08object\uff09\u5219\u662f\u4f9d\u9760 \u6784\u9020\u5668\uff08constructor\uff09\u5229\u7528 \u539f\u578b\uff08prototype\uff09\u6784\u9020\u51fa\u6765\u7684\u3002\u7136\u800c\u539f\u578b\u65b9\u5f0f\u4e2d\u7684\u6784\u9020\u5668 (constructor) \u548c\u539f\u578b (prototype) \u672c\u8eab\u4e5f\u662f\u5176\u4ed6\u5bf9\u8c61\u901a\u8fc7\u539f\u578b\u65b9\u5f0f\u6784\u9020\u51fa\u6765\u7684\u5bf9\u8c61\u3002<\/p>\n<p><strong>\u4e8c\uff0cJavascript\u539f\u578b\u94fe?<\/strong><\/p>\n<p>\u7b54\u6848\uff1a\u56de\u7b54\u91cd\u70b9<br \/>\n\u5728\u8c03\u7528\u67d0\u4e2a\u5bf9\u8c61\u7684\u5c5e\u6027\u6216\u65b9\u6cd5\u65f6\uff0cjs\u5f15\u64ce\u4f1a\u4f18\u5148\u5728\u8be5\u5bf9\u8c61\u81ea\u8eab\u4e0a\u67e5\u627e\u8be5\u5c5e\u6027\u6216\u65b9\u6cd5\uff0c\u5982\u679c\u6ca1\u6709\u4fbf\u53bb\u8be5\u5bf9\u8c61\u7684\u6784\u9020\u51fd\u6570\u4e2d\u53bb\u67e5\u627e\uff0c\u5982\u6b64\u9010\u7ea7\u9012\u5f52\u7684\u67e5\u627e\uff0c\u76f4\u5230\u539f\u578b\u94fe\u7684\u9876\u7aef\uff0c\uff08<strong>\u5411\u4e0a\u4e00\u7ea7\u4e00\u7ea7\u67e5\u627e<\/strong>\uff09<\/p>\n<p><strong>\u4e09\uff0cJavascript\u521b\u5efa\u5bf9\u8c61\u7684\u51e0\u79cd\u65b9\u5f0f\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<pre class=\"brush:js;toolbar:false\">1\u3001 \u5bf9\u8c61\u5b57\u9762\u91cf\u7684\u65b9\u5f0f\r\nperson = {\r\n\tfirstname: \"Mark\",\r\n\tlastname: \"Yun\",\r\n\tage: 25,\r\n\teyecolor: \"black\"\r\n};\r\n\r\n2\u3001 \u7528function\u6765\u6a21\u62df\u65e0\u53c2\u7684\u6784\u9020\u51fd\u6570\r\nfunction Person() {}\r\nvar person = new Person(); \/\/\u5b9a\u4e49\u4e00\u4e2afunction\uff0c\u5982\u679c\u4f7f\u7528new\"\u5b9e\u4f8b\u5316\",\u8be5function\u53ef\u4ee5\u770b\u4f5c\u662f\u4e00\u4e2aClass\r\nperson.name = \"Mark\";\r\nperson.age = \"25\";\r\nperson.work = function() {\r\n\talert(person.name + \" hello...\");\r\n}\r\nperson.work();\r\n\r\n3\u3001 \u7528function\u6765\u6a21\u62df\u6709\u53c2\u6784\u9020\u51fd\u6570\u6765\u5b9e\u73b0\uff08 \u7528this\u5173\u952e\u5b57\u5b9a\u4e49\u6784\u9020\u7684\u4e0a\u4e0b\u6587\u5c5e\u6027\uff09\r\nfunction Pet(name, age, hobby) {\r\n\tthis.name = name; \/\/this\u4f5c\u7528\u57df\uff1a\u5f53\u524d\u5bf9\u8c61\r\n\tthis.age = age;\r\n\tthis.hobby = hobby;\r\n\tthis.eat = function() {\r\n\t\talert(\"\u6211\u53eb\" + this.name + \",\u6211\u559c\u6b22\" + this.hobby + \",\u662f\u4e2a\u7a0b\u5e8f\u5458\");\r\n\t}\r\n}\r\nvar maidou = new Pet(\"\u9ea6\u515c\", 25, \"coding\"); \/\/\u5b9e\u4f8b\u5316\u3001\u521b\u5efa\u5bf9\u8c61\r\nmaidou.eat(); \/\/\u8c03\u7528eat\u65b9\u6cd5\r\n\r\n4\u3001 \u7528\u5de5\u5382\u65b9\u5f0f\u6765\u521b\u5efa\uff08 \u5185\u7f6e\u5bf9\u8c61\uff09\r\nvar wcDog = new Object();\r\nwcDog.name = \"\u65fa\u8d22\";\r\nwcDog.age = 3;\r\nwcDog.work = function() {\r\n\talert(\"\u6211\u662f\" + wcDog.name + \",\u6c6a\u6c6a\u6c6a......\");\r\n}\r\nwcDog.work();\r\n\r\n5\u3001 \u7528\u539f\u578b\u65b9\u5f0f\u6765\u521b\u5efa\r\nfunction Dog() {}\r\nDog.prototype.name = \"\u65fa\u8d22\";\r\nDog.prototype.eat = function() {\r\n\talert(this.name + \"\u662f\u4e2a\u5403\u8d27\");\r\n}\r\nvar wangcai = new Dog();\r\nwangcai.eat();\r\n\r\n6\u3001 \u7528\u6df7\u5408\u65b9\u5f0f\u6765\u521b\u5efa\r\nfunction Car(name, price) {\r\n\tthis.name = name;\r\n\tthis.price = price;\r\n}\r\nCar.prototype.sell = function() {\r\n\talert(\"\u6211\u662f\" + this.name + \"\uff0c\u6211\u73b0\u5728\u5356\" + this.price + \"\u4e07\u5143\");\r\n}\r\nvar camry = new Car(\"\u51ef\u7f8e\u745e\", 27);\r\ncamry.sell();<\/pre>\n<p><strong>\u56db\uff0c\u6d45\u8c08\u524d\u7aef\u6027\u80fd\u4f18\u5316\u7684\u95ee\u9898\uff1f<\/strong><\/p>\n<p>\u7b54\u6848\uff1a<\/p>\n<p>\u25cf\u3000step1\uff0c\u4f7f\u7528CDN\u52a0\u901f\uff0c<\/p>\n<p>\u25cf\u3000step2\uff0c\u9759\u6001\u8d44\u6e90\u7684\u538b\u7f29\u5408\u5e76\uff0c<\/p>\n<p>\u25cf\u3000step3\uff0c\u51cf\u5c11HTTP\u8bf7\u6c42\uff0c<\/p>\n<p>\u25cf\u3000step4\uff0c\u5c3d\u53ef\u80fd\u7684\u51cf\u5c11DOM\u64cd\u4f5c\uff0c<\/p>\n<p>\u25cf\u3000step5\uff0c\u7531\u4e8e\u6d4f\u89c8\u5668\u6e32\u67d3\u673a\u5236\u7684\u5f71\u54cd\uff0cJS,CSS\u6587\u4ef6\u653e\u5728\u9875\u9762\u6700\u5e95\u90e8<\/p>\n<p>\u25cf\u3000step6\uff0c\u4f7f\u7528\u61d2\u52a0\u8f7d\uff0c<\/p>\n<p>\u25cf\u3000step7\uff0c\u4f7f\u7528\u6d4f\u89c8\u5668\u7f13\u5b58,\u672c\u5730\u5b58\u50a8\uff0c\u51cf\u5c11\u8bf7\u6c42\u6570\u91cf<\/p>\n<p>\u25cf\u3000step8\uff0c\u4f7f\u7528SSR(server side rendering)\u540e\u7aef\u6e32\u67d3\uff0c\u6570\u636e\u76f4\u63a5\u8f93\u51fa\u5230HTML<\/p>\n<p>\u25cf\u3000step9\uff0c\u9879\u76ee\u4e2d\u91c7\u7528\u6309\u9700\u52a0\u8f7d<\/p>\n<p>\u6e32\u67d3\u7c7b\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a<\/p>\n<p>\u25cf\u3000step1\uff0c\u538b\u7f29\u56fe\u7247\uff0c<\/p>\n<p>\u25cf\u3000step2\uff0c\u5c3d\u91cf\u4f7f\u7528CSS\u52a8\u753b\uff0c\u5f00\u542fGPU\u52a0\u901f<\/p>\n<p>\u25cf\u3000step3\uff0cIconfont\u4ee3\u66ff\u56fe\u7247<\/p>\n<p>\u25cf\u3000step4, \u7cbe\u7b80\u4ee3\u7801\uff0c\u538b\u7f29\u4ee3\u7801<\/p>\n<p><strong>\u4e94\uff0cDOM\u64cd\u4f5c\u2014\u2014\u600e\u6837\u6dfb\u52a0\u3001\u79fb\u9664\u3001\u79fb\u52a8\u3001\u590d\u5236\u3001\u521b\u5efa\u548c\u67e5\u627e\u8282\u70b9?<\/strong><\/p>\n<pre class=\"brush:js;toolbar:false\">\uff081\uff09\u521b\u5efa\u65b0\u8282\u70b9\r\n    createDocumentFragment()    \/\/\u521b\u5efa\u4e00\u4e2aDOM\u7247\u6bb5\r\n    createElement()   \/\/\u521b\u5efa\u4e00\u4e2a\u5177\u4f53\u7684\u5143\u7d20\r\n    createTextNode()   \/\/\u521b\u5efa\u4e00\u4e2a\u6587\u672c\u8282\u70b9\r\n\uff082\uff09\u6dfb\u52a0\u3001\u79fb\u9664\u3001\u66ff\u6362\u3001\u63d2\u5165\r\n    appendChild()\r\n    removeChild()\r\n    replaceChild()\r\n    insertBefore() \/\/\u5728\u5df2\u6709\u7684\u5b50\u8282\u70b9\u524d\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5b50\u8282\u70b9\r\n\uff083\uff09\u67e5\u627e\r\n    getElementsByTagName()    \/\/\u901a\u8fc7\u6807\u7b7e\u540d\u79f0\r\n    getElementsByName()    \/\/\u901a\u8fc7\u5143\u7d20\u7684Name\u5c5e\u6027\u7684\u503c(IE\u5bb9\u9519\u80fd\u529b\u8f83\u5f3a\uff0c\u4f1a\u5f97\u5230\u4e00\u4e2a\u6570\u7ec4\uff0c\u5176\u4e2d\u5305\u62ecid\u7b49\u4e8ename\u503c\u7684)\r\n    getElementById()    \/\/\u901a\u8fc7\u5143\u7d20Id\uff0c\u552f\u4e00\u6027<\/pre>\n<p><strong>\u7ed3\u675f\u8bed<\/strong><\/p>\n<p>\u4ee5\u4e0a\u4e3a\u603b\u7ed3\u7684\u5e38\u89c1\u7684\u9762\u8bd5\u95ee\u9898\u3002<strong><br \/>\n<\/strong><\/p>\n<p>\u672c\u6587\u6765\u81ea\uff1a\u7b80\u4e66 \u4f5c\u8005\uff1a\u613f\u9192\u9759\u5367\u5fd8\u5c18\u8c37<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f2019\u5e74\u524d\u7aef\u9762\u8bd5\u9898\u603b\u7ed3\u4ee5\u53ca\u4e00\u4e9b\u9762\u8bd5\u5fc3\u5f97\uff08\u9644\u7b54\u6848\uff09\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8html\u4e2d\u6587\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6cbf \u5c0f\u7f16\u5728\u8fd9\u51e0\u5e74\u7684\u524d\u7aef\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5386\u4e86\u7531js,jquery\u5230vue,\u7531\u64cd\u4f5cdom\u5230\u6570\u636e\u9a71\u52a8\u9875\u9762\uff0c\u7531\u53ea\u5199pc [&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":[],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2626"}],"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=2626"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2626\/revisions"}],"predecessor-version":[{"id":2630,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2626\/revisions\/2630"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}