{"id":828,"date":"2018-01-20T14:58:25","date_gmt":"2018-01-20T06:58:25","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=828"},"modified":"2018-01-20T14:58:25","modified_gmt":"2018-01-20T06:58:25","slug":"%e5%a6%82%e4%bd%95%e5%88%a4%e6%96%adjavascript%e5%af%b9%e8%b1%a1%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=828","title":{"rendered":"\u5982\u4f55\u5224\u65adJavascript\u5bf9\u8c61\u662f\u5426\u5b58\u5728"},"content":{"rendered":"<p>\n\tJavascript\u8bed\u8a00\u7684\u8bbe\u8ba1\u4e0d\u591f\u4e25\u8c28\uff0c\u5f88\u591a\u5730\u65b9\u4e00\u4e0d\u5c0f\u5fc3\u5c31\u4f1a\u51fa\u9519\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4e3e\u4f8b\u6765\u8bf4\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u60c5\u51b5\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u73b0\u5728\uff0c\u6211\u4eec\u8981\u5224\u65ad\u4e00\u4e2a\u5168\u5c40\u5bf9\u8c61myObj\u662f\u5426\u5b58\u5728\uff0c\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5c31\u5bf9\u5b83\u8fdb\u884c\u58f0\u660e\u3002\u7528\u81ea\u7136\u8bed\u8a00\u63cf\u8ff0\u7684\u7b97\u6cd5\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (myObj\u4e0d\u5b58\u5728){\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u58f0\u660emyObj;\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4f60\u53ef\u80fd\u4f1a\u89c9\u5f97\uff0c\u5199\u51fa\u8fd9\u6bb5\u4ee3\u7801\u5f88\u5bb9\u6613\u3002\u4f46\u662f\u5b9e\u9645\u4e0a\uff0c\u5b83\u6d89\u53ca\u7684\u8bed\u6cd5\u95ee\u9898\uff0c\u8fdc\u6bd4\u6211\u4eec\u60f3\u8c61\u7684\u590d\u6742\u3002Juriy Zaytsev\u6307\u51fa\uff0c\u5224\u65ad\u4e00\u4e2aJavascript\u5bf9\u8c61\u662f\u5426\u5b58\u5728\uff0c\u6709\u8d85\u8fc750\u79cd\u5199\u6cd5\u3002\u53ea\u6709\u5bf9Javascript\u8bed\u8a00\u7684\u5b9e\u73b0\u7ec6\u8282\u975e\u5e38\u6e05\u695a\uff0c\u624d\u53ef\u80fd\u5206\u5f97\u6e05\u5b83\u4eec\u7684\u533a\u522b\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e00\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u6839\u636e\u76f4\u89c9\uff0c\u4f60\u53ef\u80fd\u89c9\u5f97\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tmyObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4f46\u662f\uff0c\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u6d4f\u89c8\u5668\u4f1a\u76f4\u63a5\u629b\u51faReferenceError\u9519\u8bef\uff0c\u5bfc\u81f4\u8fd0\u884c\u4e2d\u65ad\u3002\u8bf7\u95ee\u9519\u5728\u54ea\u91cc\uff1f\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u5bf9\u4e86\uff0cif\u8bed\u53e5\u5224\u65admyObj\u662f\u5426\u4e3a\u7a7a\u65f6\uff0c\u8fd9\u4e2a\u53d8\u91cf\u8fd8\u4e0d\u5b58\u5728\uff0c\u6240\u4ee5\u624d\u4f1a\u62a5\u9519\u3002\u6539\u6210\u4e0b\u9762\u8fd9\u6837\uff0c\u5c31\u80fd\u6b63\u786e\u8fd0\u884c\u4e86\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4e3a\u4ec0\u4e48\u52a0\u4e86\u4e00\u4e2avar\u4ee5\u540e\uff0c\u5c31\u4e0d\u62a5\u9519\u4e86\uff1f\u96be\u9053\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cif\u8bed\u53e5\u505a\u5224\u65ad\u65f6\uff0cmyObj\u5c31\u5df2\u7ecf\u5b58\u5728\u4e86\u5417\uff1f\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u8981\u56de\u7b54\u8fd9\u4e2a\u95ee\u9898\uff0c\u5c31\u5fc5\u987b\u77e5\u9053Javascript\u89e3\u91ca\u5668\u7684\u5de5\u4f5c\u65b9\u5f0f\u3002Javascript\u8bed\u8a00\u662f\"\u5148\u89e3\u6790\uff0c\u540e\u8fd0\u884c\"\uff0c\u89e3\u6790\u65f6\u5c31\u5df2\u7ecf\u5b8c\u6210\u4e86\u53d8\u91cf\u58f0\u660e\uff0c\u6240\u4ee5\u4e0a\u9762\u7684\u4ee3\u7801\u5b9e\u9645\u7b49\u540c\u4e8e\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj;\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u56e0\u6b64\uff0cif\u8bed\u53e5\u505a\u5224\u65ad\u65f6\uff0cmyObj\u786e\u5b9e\u5df2\u7ecf\u5b58\u5728\u4e86\uff0c\u6240\u4ee5\u5c31\u4e0d\u62a5\u9519\u4e86\u3002\u8fd9\u5c31\u662fvar\u547d\u4ee4\u7684\"\u4ee3\u7801\u63d0\u5347\"\uff08hoisting\uff09\u4f5c\u7528\u3002Javascript\u89e3\u91ca\u5668\uff0c\u53ea\"\u63d0\u5347\"var\u547d\u4ee4\u5b9a\u4e49\u7684\u53d8\u91cf\uff0c\u5bf9\u4e0d\u4f7f\u7528var\u547d\u4ee4\u3001\u76f4\u63a5\u8d4b\u503c\u7684\u53d8\u91cf\u4e0d\u8d77\u4f5c\u7528\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4e0d\u52a0var\u4f1a\u62a5\u9519\u7684\u539f\u56e0\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e8c\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u9664\u4e86var\u547d\u4ee4\uff0c\u8fd8\u53ef\u4ee5\u6709\u53e6\u4e00\u79cd\u6539\u5199\uff0c\u4e5f\u80fd\u5f97\u5230\u6b63\u786e\u7684\u7ed3\u679c\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!window.myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tmyObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\twindow\u662fjavascript\u7684\u9876\u5c42\u5bf9\u8c61\uff0c\u6240\u6709\u7684\u5168\u5c40\u53d8\u91cf\u90fd\u662f\u5b83\u7684\u5c5e\u6027\u3002\u6240\u4ee5\uff0c\u5224\u65admyobj\u662f\u5426\u4e3a\u7a7a\uff0c\u7b49\u540c\u4e8e\u5224\u65adwindow\u5bf9\u8c61\u662f\u5426\u6709myobj\u5c5e\u6027\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u907f\u514d\u56e0\u4e3amyObj\u6ca1\u6709\u5b9a\u4e49\u800c\u51fa\u73b0ReferenceError\u9519\u8bef\u3002\u4e0d\u8fc7\uff0c\u4ece\u4ee3\u7801\u7684\u89c4\u8303\u6027\u8003\u8651\uff0c\u6700\u597d\u8fd8\u662f\u5bf9\u7b2c\u4e8c\u884c\u52a0\u4e0avar\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!window.myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u6216\u8005\u5199\u6210\u8fd9\u6837\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!window.myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\twindow.myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e09\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4e0a\u9762\u8fd9\u79cd\u5199\u6cd5\u7684\u7f3a\u70b9\u5728\u4e8e\uff0c\u5728\u67d0\u4e9b\u8fd0\u884c\u73af\u5883\u4e2d\uff08\u6bd4\u5982V8\u3001Rhino\uff09\uff0cwindow\u672a\u5fc5\u662f\u9876\u5c42\u5bf9\u8c61\u3002\u6240\u4ee5\uff0c\u8003\u8651\u6539\u5199\u6210\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!this.myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tthis.myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u5728\u5168\u5c40\u53d8\u91cf\u7684\u5c42\u9762\u4e2d\uff0cthis\u5173\u952e\u5b57\u603b\u662f\u6307\u5411\u9876\u5c42\u53d8\u91cf\uff0c\u6240\u4ee5\u5c31\u53ef\u4ee5\u72ec\u7acb\u4e8e\u4e0d\u540c\u7684\u8fd0\u884c\u73af\u5883\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u56db\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4f46\u662f\uff0c\u4e0a\u9762\u8fd9\u6837\u5199\u53ef\u8bfb\u6027\u8f83\u5dee\uff0c\u800c\u4e14this\u7684\u6307\u5411\u662f\u53ef\u53d8\u7684\uff0c\u5bb9\u6613\u51fa\u9519\uff0c\u6240\u4ee5\u8fdb\u4e00\u6b65\u6539\u5199\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar global = this;\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!global.myObj) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tglobal.myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u7528\u81ea\u5b9a\u4e49\u53d8\u91cfglobal\u8868\u793a\u9876\u5c42\u5bf9\u8c61\uff0c\u5c31\u6e05\u695a\u591a\u4e86\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e94\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u8fd8\u53ef\u4ee5\u4f7f\u7528typeof\u8fd0\u7b97\u7b26\uff0c\u5224\u65admyObj\u662f\u5426\u6709\u5b9a\u4e49\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (typeof myObj == \"undefined\") {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u8fd9\u662f\u76ee\u524d\u4f7f\u7528\u6700\u5e7f\u6cdb\u7684\u5224\u65adjavascript\u5bf9\u8c61\u662f\u5426\u5b58\u5728\u7684\u65b9\u6cd5\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u516d\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u7531\u4e8e\u5728\u5df2\u5b9a\u4e49\u3001\u4f46\u672a\u8d4b\u503c\u7684\u60c5\u51b5\u4e0b\uff0cmyObj\u7684\u503c\u76f4\u63a5\u7b49\u4e8eundefined\uff0c\u6240\u4ee5\u4e0a\u9762\u7684\u5199\u6cd5\u53ef\u4ee5\u7b80\u5316\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (myObj == undefined) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u8fd9\u91cc\u6709\u4e24\u4e2a\u5730\u65b9\u9700\u8981\u6ce8\u610f\uff0c\u9996\u5148\u7b2c\u4e8c\u884c\u7684var\u5173\u952e\u5b57\u4e0d\u80fd\u5c11\uff0c\u5426\u5219\u4f1a\u51fa\u73b0ReferenceError\u9519\u8bef\uff0c\u5176\u6b21undefined\u4e0d\u80fd\u52a0\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\uff0c\u56e0\u4e3a\u8fd9\u91cc\u6bd4\u8f83\u7684\u662fundefined\u8fd9\u79cd\u6570\u636e\u7c7b\u578b\uff0c\u800c\u4e0d\u662f\"undefined\"\u8fd9\u4e2a\u5b57\u7b26\u4e32\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e03\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4e0a\u9762\u7684\u5199\u6cd5\u5728\"\u7cbe\u786e\u6bd4\u8f83\"\uff08===\uff09\u7684\u60c5\u51b5\u4e0b\uff0c\u4f9d\u7136\u6210\u7acb\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (myObj === undefined) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u516b\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u6839\u636ejavascript\u7684\u8bed\u8a00\u8bbe\u8ba1\uff0cundefined == null\uff0c\u6240\u4ee5\u6bd4\u8f83myObj\u662f\u5426\u7b49\u4e8enull\uff0c\u4e5f\u80fd\u5f97\u5230\u6b63\u786e\u7ed3\u679c\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (myObj == null) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tvar myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u4e0d\u8fc7\uff0c\u867d\u7136\u8fd0\u884c\u7ed3\u679c\u6b63\u786e\uff0c\u4f46\u662f\u4ece\u8bed\u4e49\u4e0a\u770b\uff0c\u8fd9\u79cd\u5224\u65ad\u65b9\u6cd5\u662f\u9519\u7684\uff0c\u5e94\u8be5\u907f\u514d\u3002\u56e0\u4e3anull\u6307\u7684\u662f\u5df2\u7ecf\u8d4b\u503c\u4e3anull\u7684\u7a7a\u5bf9\u8c61\uff0c\u5373\u8fd9\u4e2a\u5bf9\u8c61\u5b9e\u9645\u4e0a\u662f\u6709\u503c\u7684\uff0c\u800cundefined\u6307\u7684\u662f\u4e0d\u5b58\u5728\u6216\u6ca1\u6709\u8d4b\u503c\u7684\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u8fd9\u91cc\u53ea\u80fd\u4f7f\u7528\"\u6bd4\u8f83\u8fd0\u7b97\u7b26\"\uff08==\uff09\uff0c\u5982\u679c\u8fd9\u91cc\u4f7f\u7528\"\u7cbe\u786e\u6bd4\u8f83\u8fd0\u7b97\u7b26\"\uff08===\uff09\uff0c\u5c31\u4f1a\u51fa\u9519\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u4e5d\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u8fd8\u53ef\u4ee5\u4f7f\u7528in\u8fd0\u7b97\u7b26\uff0c\u5224\u65admyObj\u662f\u5426\u4e3a\u9876\u5c42\u5bf9\u8c61\u7684\u4e00\u4e2a\u5c5e\u6027\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!('myObj' in window)) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\twindow.myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<strong>\u7b2c\u5341\u79cd\u5199\u6cd5<\/strong>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u6700\u540e\uff0c\u4f7f\u7528hasOwnProperty\u65b9\u6cd5\uff0c\u5224\u65admyObj\u662f\u5426\u4e3a\u9876\u5c42\u5bf9\u8c61\u7684\u4e00\u4e2a\u5c5e\u6027\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tif (!this.hasOwnProperty('myObj')) {\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tthis.myObj = { };\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t}\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u603b\u7ed3\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t1. \u5982\u679c\u53ea\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u5b58\u5728\uff0c\u63a8\u8350\u4f7f\u7528\u7b2c\u4e94\u79cd\u5199\u6cd5\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t2. \u5982\u679c\u9664\u4e86\u5bf9\u8c61\u662f\u5426\u5b58\u5728\uff0c\u8fd8\u8981\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u6709null\u503c\uff0c\u63a8\u8350\u4f7f\u7528\u7b2c\u4e00\u79cd\u5199\u6cd5\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t3. \u9664\u975e\u7279\u6b8a\u60c5\u51b5\uff0c\u6240\u6709\u53d8\u91cf\u90fd\u5e94\u8be5\u4f7f\u7528var\u547d\u4ee4\u58f0\u660e\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t4. \u4e3a\u4e86\u8de8\u5e73\u53f0\uff0c\u5efa\u8bae\u907f\u514d\u4f7f\u7528window\u8868\u793a\u9876\u5c42\u5bf9\u8c61\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t5. \u5728Javascript\u8bed\u8a00\u4e2d\uff0cnull\u548cundefined\u5bb9\u6613\u4ea7\u751f\u6df7\u6dc6\u3002\u5728\u53ef\u80fd\u540c\u65f6\u6d89\u53ca\u4e24\u8005\u7684\u60c5\u51b5\u4e0b\uff0c\u5efa\u8bae\u4f7f\u7528\"\u7cbe\u786e\u6bd4\u8f83\"\u8fd0\u7b97\u7b26\uff08===\uff09\u3002\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Javascript\u8bed\u8a00\u7684\u8bbe\u8ba1\u4e0d\u591f\u4e25\u8c28\uff0c\u5f88\u591a\u5730\u65b9\u4e00\u4e0d\u5c0f\u5fc3\u5c31\u4f1a\u51fa\u9519\u3002 \u4e3e\u4f8b\u6765\u8bf4\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u60c5\u51b5\u3002 \u73b0\u5728\uff0c\u6211\u4eec\u8981\u5224\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=828\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-828","post","type-post","status-publish","format-standard","hentry","category-js"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=828"}],"version-history":[{"count":1,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/828\/revisions"}],"predecessor-version":[{"id":829,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/828\/revisions\/829"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}