{"id":8522,"date":"2019-03-02T20:52:01","date_gmt":"2019-03-02T12:52:01","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8522"},"modified":"2019-03-02T20:54:10","modified_gmt":"2019-03-02T12:54:10","slug":"dom-contains-comparedocumentposition","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2019\/03\/dom-contains-comparedocumentposition\/","title":{"rendered":"DOM\u5c0f\u6d4b28\u671f &#8211; DOM\u8282\u70b9\u6587\u6863\u524d\u540e\u4f4d\u7f6e\u5224\u65ad"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8522\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=8522<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4e2a\u4eba\u7f51\u7ad9\u65e0\u9700\u6388\u6743\uff0c\u53ea\u8981\u4fdd\u7559\u539f\u4f5c\u8005\u3001\u51fa\u5904\u4ee5\u53ca\u6587\u4e2d\u94fe\u63a5\u5373\u53ef\uff0c\u4efb\u4f55\u7f51\u7ad9\u5747\u53ef\u6458\u8981\u805a\u5408\uff0c\u5546\u7528\u8bf7\u8054\u7cfb\u6388\u6743\u3002<br \/>\n<script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/201901-quiz.jpg';<\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201901\/quiz-thumb.jpg\" width=\"484\" height=\"300\" alt=\"\u5c0f\u6d4b\u5934\u56fe\" class=\"alignnone clip size-medium\" \/><\/p>\n<h3>\u4e00\u3001\u9898\u76ee\u4e0e\u8003\u5bdf\u70b9<\/h3>\n<p>\u9898\u76ee\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/zhangxinxu\/quiz\/issues\/9\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/zhangxinxu\/quiz\/issues\/9<\/a><\/p>\n<p>\u9898\u76ee\u5185\u5bb9\u5982\u4e0b\uff08\u70b9\u51fb\u67e5\u770b\u5927\u56fe\uff09\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201903\/dom-28.jpg\" width=\"300\" height=\"410\" alt=\"DOM\u5c0f\u6d4b28\u671f\u9898\u76ee\" class=\"alignnone size-medium\" style=\"max-width:600px;\" onclick=\"this.removeAttribute('width');this.removeAttribute('height')\" \/><\/p>\n<p>\u672c\u9898\u4e3b\u8981\u8003\u5bdf\u5982\u4f55\u5224\u65adDOM\u8282\u70b9\u6587\u6863\u524d\u540e\u4f4d\u7f6e\uff0c\u7236\u5b50\u5173\u7cfb\u7b49\u3002\u6211\u770b\u4e86\u4e0b\u6700\u540e\u7684\u56de\u7b54\uff0c\u8fd19\u6210\u7684\u56de\u7b54\u4f7f\u7528\u4e86\u975e\u5e38\u5570\u55e6\u7684\u65b9\u6cd5\uff0c\u6bd4\u4f8b\u4e4b\u9ad8\uff0c\u5b9e\u5728\u51fa\u4e4e\u610f\u6599\u3002\u5b9e\u9645\u4e0a\uff0c\u672c\u9898\u6709\u975e\u5e38\u7b80\u5355\u3001\u5be5\u5be5\u6570\u884c\u5c31\u80fd\u5b9e\u73b0\u7684\u65b9\u6cd5\uff0c\u53ea\u8981\u4f60\u77e5\u9053\u4e0b\u9762\u8fd9\u4e24\u4e2a\u5f88\u6709\u7528\u7684DOM\u539f\u751fAPI\uff0c\u4e00\u4e2a\u662f<code>contains()<\/code>\u65b9\u6cd5\uff0c\u5224\u65adDOM\u5143\u7d20\u6216\u8282\u70b9\u662f\u5426\u6709\u5305\u542b\u5173\u7cfb\uff1b\u53e6\u5916\u4e00\u4e2a\u662f<code>compareDocumentPosition()<\/code>\u65b9\u6cd5\uff0c\u66f4\u5f3a\u608d\u7684DOM\u6216\u8282\u70b9\u4f4d\u7f6e\u5173\u7cfb\u5224\u65ad\uff0c\u65e0\u8bba\u662f\u524d\u540e\u3001\u5185\u5916\u8fd8\u662f\u8de8\u6587\u6863\u90fd\u53ef\u4ee5\u3002<\/p>\n<p>\u672c\u6b21B\u7ad9\u7b54\u7591\u76f4\u64ad\u5728\u4e0a\u534810:34\u5206\u5f00\u59cb\uff0c\u6301\u7eed\u7ea630\u5206\u949f\uff0c\u6709\u5f55\u64ad\uff0c\u53ef\u4ee5\u76f4\u63a5\u70b9\u51fb\u4e0b\u9762\u7684\u89c6\u9891\u89c2\u770b\u3002<\/p>\n<p><iframe loading=\"lazy\" id=\"biliIframe\" src=\"\/\/player.bilibili.com\/player.html?aid=45096006&#038;cid=78973861&#038;page=1\" scrolling=\"no\" border=\"0\" frameborder=\"no\" framespacing=\"0\" allowfullscreen=\"true\" width=\"100%\" height=\"546\"><\/iframe><\/p>\n<p><script>if (screen.width < 640) { document.getElementById('biliIframe').style.height = '60vw'; }<\/script><\/p>\n<h3>\u4e8c\u3001DOM\u5305\u542b\u5173\u7cfb\u5224\u65adcontains()<\/h3>\n<p><code>contains()<\/code>\u65b9\u6cd5\u662f\u4e00\u4e2a\u5f88\u53e4\u8001\u7684API\uff0c\u7528\u6765\u5224\u65ad\u4e24\u4e2aDOM\u8282\u70b9\u4e4b\u95f4\u7684\u5305\u542b\u5173\u7cfb\uff0c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>node.contains(otherNode)<\/pre>\n<p>\u8fd4\u56de\u5e03\u5c14\u503c\uff0c\u8868\u793a<code>node<\/code>\u662f\u5426\u5305\u542b<code>otherNode<\/code>\uff0c\u6216\u8005\u5c31\u662f<code>node<\/code>\u672c\u8eab\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>document.documentElement.contains(document.body);    <span style=\"color:green;\">\/\/ \u8fd4\u56de\u503c\u662ftrue<\/span>\r\ndocument.body.contains(document.body);               <span style=\"color:green;\">\/\/ \u8fd4\u56de\u503c\u662ftrue<\/span>\r\ndocument.body.contains(document.documentElement);    <span style=\"color:green;\">\/\/ \u8fd4\u56de\u503c\u662ffalse<\/span><\/pre>\n<p>\u6b64API\u517c\u5bb9\u6027\u826f\u597d\uff0cIE5\u5c31\u5f00\u59cb\u652f\u6301\u4e86\uff0c\u4f7f\u7528\u975e\u5e38\u65b9\u4fbf\uff0c\u6211\u4eec\u65e0\u9700\u4e13\u95e8\u904d\u5386\u7956\u5148\u5143\u7d20\u7528\u5224\u65ad\u4e24\u4e2a\u8282\u70b9\u4e4b\u95f4\u7684\u5d4c\u5957\u5173\u7cfb\u3002<\/p>\n<h4>\u5176\u5b83<\/h4>\n<p>\u5982\u679c\u5224\u65ad\u7684\u4e24\u4e2a\u8282\u70b9\u5143\u7d20\u662f\u8de8iframe\u6587\u6863\u7684\uff0c\u5219\u4f1a\u88ab\u8ba4\u4e3a\u662f<code>false<\/code>\u3002\u4f8b\u5982\u6211\u4eec\u76f4\u63a5<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2017\/08\/iframe-html5-blob-code-view\/\">\u501f\u52a9Blob\u52a8\u6001\u521b\u5efa\u4e00\u4e2a\u975e\u5916\u94feiframe<\/a>\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>var htmlIframe = '&lt;img id=\"img\" src=\"https:\/\/...\/mm.jpg\" onclick=\"console.log(window.parent.document.body.contains(this))\"&gt;';\r\nvar iframe = document.createElement('iframe');\r\nvar blob = new Blob([htmlIframe], { 'type': 'text\/html'});\r\niframe.src = URL.createObjectURL(blob);\r\niframeBlob1.appendChild(iframe);<\/pre>\n<style>.log-result:not(:empty)::before{content:'\u7ed3\u679c\u662f';}.log-result{color:#cd0000;}<\/style>\n<p>\u5b9e\u65f6\u6548\u679c\u5982\u4e0b\uff0c\u70b9\u51fb\u59b9\u5b50\u56fe\u7247\uff0c\u770b\u770b\u8f93\u51fa\u7684\u7ed3\u679c\u662f\uff1f<span id=\"logResult\" class=\"log-result\"><\/span><\/p>\n<div id=\"iframeBlob1\"><\/div>\n<p><script>if (window.Blob){\nvar htmlIframe = '<img decoding=\"async\" id=\"img\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm.jpg\" alt=\"\u5176\u4ed6\u6587\u6863\u56fe\u7247\" onclick=\"console.log(window.parent.document.body.contains(this));window.parent.logResult.innerHTML=window.parent.document.body.contains(this);\">';\nvar iframe = document.createElement('iframe');\nvar blob = new Blob([htmlIframe], { 'type': 'text\/html'});\niframe.src = URL.createObjectURL(blob);\niframeBlob1.appendChild(iframe);}<\/script><\/p>\n<p>\u63a7\u5236\u53f0\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201903\/2019-03-02_165610.png\" width=\"586\" height=\"85\" alt=\"iframe\u5185\u5916\u8282\u70b9\u5305\u542b\u5173\u7cfb\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5982\u679c\u60f3\u8981\u77e5\u9053iframe\u5185\u5916\u7684\u5305\u542b\u5173\u7cfb\uff0c\u5219\u9700\u8981\u4f7f\u7528\u53e6\u5916\u7684API\uff1a<code>compareDocumentPosition()<\/code>\u3002<\/p>\n<h3>\u4e09\u3001\u4efb\u610f\u4f4d\u7f6e\u5224\u65adcompareDocumentPosition<\/h3>\n<p>\u672c\u9898\u4e2d\u56fe\u7247DOM\u5143\u7d20\u524d\u540e\u4f4d\u7f6e\u7684\u6bd4\u5bf9\u5b8c\u5168\u4e0d\u9700\u8981\u5199\u5faa\u73af\u8fdb\u884c\u904d\u5386\uff0c\u6709\u73b0\u6210\u7684API\u53ef\u4ee5\u5b9e\u73b0\u6211\u4eec\u60f3\u8981\u7684\u6548\u679c\uff0c\u90a3\u5c31\u662f<code>Node.compareDocumentPosition<\/code> API\u3002<\/p>\n<p>\u6b64API\u9887\u6709\u6df1\u5ea6\uff0c\u6211\u4e13\u95e8\u5199\u4e86\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u8fd9\u4e2aAPI\uff0c\u53ef\u53c2\u89c1\u8fd9\u91cc\uff1a\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8527\">\u6df1\u5165Node.compareDocumentPosition API<\/a>\u201d\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>var compareValue = img.compareDocumentPosition(compareImg);\r\nif (compareValue == 2) {\r\n  <span style=\"color:green;\">\/\/ compareImg\u5728\u524d<\/span>\r\n} else if (compareValue == 4) {\r\n  <span style=\"color:green;\">\/\/ compareImg\u5728\u540e<\/span>\r\n} else if (compareValue == 0) {\r\n  <span style=\"color:green;\">\/\/ \u5c31\u662fcompareImg\u5143\u7d20\u81ea\u8eab<\/span>\r\n} else {\r\n  <span style=\"color:green;\">\/\/ \u5176\u5b83\u4f4d\u7f6e\u5173\u7cfb<\/span>\r\n}<\/pre>\n<p>\u5982\u679c<code>compareValue<\/code>\u662f<code>2<\/code>\uff0c\u5219\u8868\u793a<code>compareImg<\/code>\u5728<code>img<\/code>\u7684\u524d\u9762\uff1b\u5982\u679c\u662f<code>4<\/code>\uff0c\u5219\u8868\u793a<code>compareImg<\/code>\u5728<code>img<\/code>\u7684\u540e\u9762\u3002<\/p>\n<p>\u7531\u6b64\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5224\u65ad\u70b9\u51fb\u56fe\u7247\u548c\u5bf9\u6bd4\u56fe\u7247\u4e4b\u95f4\u7684\u6587\u6863\u4f4d\u7f6e\u5173\u7cfb\uff0c\u5be5\u5be5\u51e0\u884c\u4ee3\u7801\u7684\u4e8b\u60c5\u3002<\/p>\n<p>\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u662f\u5224\u65ad\u5176\u4ed6\u975e\u66ff\u6362\u5143\u7d20\u7684\u4f4d\u7f6e\u5173\u7cfb\uff0c\u5219\u4e0d\u80fd\u4f7f\u7528\u6570\u503c\u6bd4\u5bf9\uff0c\u56e0\u4e3a\u53ef\u80fd<code>compareDocumentPosition()<\/code>\u65b9\u6cd5\u6267\u884c\u540e\u7684\u503c\u662f\u4e00\u4e2a\u6df7\u5408\u6570\u503c\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><span style=\"color:green;\">\/\/ \u8fd4\u56de\u503c\u662f 10\uff0c8 + 2<\/span>\r\ndocument.body.compareDocumentPosition(document.documentElement);\r\n<span style=\"color:green;\">\/\/ \u8fd4\u56de\u503c\u662f 20\uff0c16 + 4<\/span>\r\ndocument.documentElement.compareDocumentPosition(document.body)<\/pre>\n<p>\u6211\u4eec\u9700\u8981\u4f7f\u7528\u5355\u4e2a<code>&amp;<\/code>\u7b26\u5408\u548c\u5bf9\u5e94\u76ee\u6807\u503c\u8fdb\u884c\u4e0e\u4f4d\u8fd0\u7b97\u7684\u7ed3\u679c\u6765\u5224\u5b9a\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>if (document.body.compareDocumentPosition(document.documentElement) &amp; 2) {\r\n   <span style=\"color:green;\">\/\/ document.documentElement\u5728document.body\u524d\u9762\r\n   \/\/ ...<\/span>\r\n}<\/pre>\n<p>\u5982\u679c\u4e0d\u662f\u5f88\u7406\u89e3\uff0c\u53ef\u4ee5\u8bbf\u95ee\u6211\u521a\u5199\u7684\u4e13\u95e8<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8527\">\u6df1\u5165\u4ecb\u7ecdcompareDocumentPosition<\/a>\u7684\u6587\u7ae0\u3002<\/p>\n<h3>\u56db\u3001\u5982\u4f55\u5224\u65adclick\u5143\u7d20\u662f\u56fe\u7247<\/h3>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>container.onclick = function (event) {\r\n  <span style=\"color:green;\">\/\/ event.target ...<\/span>\r\n}<\/pre>\n<p>\u4e1a\u754c\u7528\u7684\u6bd4\u8f83\u591a\u7684\u65b9\u6cd5\u662f\u4f7f\u7528tagName\u503c\u8fdb\u884c\u5224\u65ad\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>event.target.tagName == 'IMG'  <span style=\"color:green;\">\/\/ true\u6216false<\/span><\/pre>\n<p>\u6240\u6709\u6d4f\u89c8\u5668\u90fd\u8fd4\u56de\u5927\u5199\u6807\u7b7e\u540d\uff0c\u5f53\u7136\uff0c\u5982\u679c\u4f60\u4e0d\u653e\u5fc3\uff08\u4ee5\u540e\u53d8\u4e86\uff0c\u6216\u8005\u9047\u5230SB\u6d4f\u89c8\u5668\uff09\uff0c\u53ef\u4ee5\u66f4\u4e25\u683c\u6bd4\u5bf9\u4e0b\uff1a<\/p>\n<pre>\/^img$\/i.test(event.target.tagName)    <span style=\"color:green;\">\/\/ true\u6216false<\/span><\/pre>\n<pre>event.target.tagName.toLowerCase() == 'img'    <span style=\"color:green;\">\/\/ true\u6216false<\/span><\/pre>\n<p>\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528nodeName\u8fdb\u884c\u5224\u65ad\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>event.target.nodeName == 'IMG'    <span style=\"color:green;\">\/\/ true\u6216false<\/span><\/pre>\n<p>\u6700\u540e\uff0c\u5728\u4ecb\u7ecd\u4e00\u79cd\u5bf9\u8c61\u7c7b\u578b\u5224\u65ad\u65b9\u6cd5\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>event.target instanceof Image    <span style=\"color:green;\">\/\/ true\u6216false<\/span><\/pre>\n<p>\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n<h3>\u4e94\u3001\u7b54\u7591\u8981\u70b9\u603b\u7ed3<\/h3>\n<ol>\n<li>\u5305\u542b\u5173\u7cfb\u63a8\u8350\u4f7f\u7528<code>Node.contains()<\/code>\u65b9\u6cd5\uff1b<\/li>\n<li>\u5224\u65ad\u5f53\u524d\u5143\u7d20\u662f\u5426\u662fIMG\uff0c\u53ef\u4ee5 \uff1a\n<pre>event.target.tagName\/nodeName == 'IMG'<\/pre>\n<pre>\/^img$\/i.test(event.target.tagName)<\/pre>\n<pre>event.target.tagName.toLowerCase() == 'img'<\/pre>\n<pre>event.target instanceof Image<\/pre>\n<\/li>\n<li>\u524d\u540e\u8282\u70b9\u5173\u7cfb\u5224\u65ad\u4f7f\u7528<code>Node.compareDocumentPosition()<\/code>\u3002<\/li>\n<\/ol>\n<p><strong>\u5173\u4e8e\u76f4\u64ad\u7b54\u7591<\/strong><\/p>\n<p>\u6bcf\u5468\u4e09\u4f1a\u5728\u8fd9\u4e2a<a href=\"https:\/\/github.com\/zhangxinxu\/quiz\" rel=\"noopener\" target=\"_blank\">\u9879\u76ee<\/a>\u7684<a href=\"https:\/\/github.com\/zhangxinxu\/quiz\/issues\" rel=\"noopener\" target=\"_blank\">issues<\/a>\u4e2d\u53d1\u5e03\u5c0f\u6d4b\u9898\uff0c\u4f9d\u6b21CSS\uff0cJS\u548cDOM\uff0c\u6bcf\u5468\u516d\u4e0a\u534810:00~11:00\u4e4b\u95f4\u76f4\u64ad\u7b54\u7591\u3002<\/p>\n<p>\u6709\u5174\u8da3\u53c2\u4e0e\u7684\u53ef\u4ee5\u591a\u591a\u5173\u6ce8\u4e0b\u3002<\/p>\n<p>\u4ee5\u4e0a~<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/emtion\/emoji\/1f468-200d-1f4bb.svg\" width=\"20\" height=\"20\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=8522\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=8522<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201901\/quiz-thumb.jpg\" width=\"161\" height=\"100\" alt=\"DOM\u5c0f\u6d4b\u5934\u56fe\" lazyload=\"on\" class=\"alignright size-medium\"><\/p>\n<p>\u672c\u9898\u4e3b\u8981\u8003\u5bdf\u5982\u4f55\u5224\u65adDOM\u8282\u70b9\u6587\u6863\u524d\u540e\u4f4d\u7f6e\uff0c\u7236\u5b50\u5173\u7cfb\u7b49\u3002\u6211\u770b\u4e86\u4e0b\u6700\u540e\u7684\u56de\u7b54\uff0c\u8fd19\u6210\u7684\u56de\u7b54\u4f7f\u7528\u4e86\u975e\u5e38\u5570\u55e6\u7684\u65b9\u6cd5\uff0c\u6bd4\u4f8b\u4e4b\u9ad8\uff0c\u5b9e\u5728\u51fa\u4e4e\u610f\u6599\u3002\u5b9e\u9645\u4e0a\uff0c\u672c\u9898\u7b54\u6848\u53ea\u9700\u5be5\u5be5\u6570\u884c\uff0c\u56e0\u4e3a\u6709\u539f\u751f\u7684API\uff0c<code>contains()<\/code>\u53ef\u4ee5\u5224\u65ad\u8282\u70b9\u662f\u5426\u6709\u5305\u542b\u5173\u7cfb\uff1b<code>compareDocumentPosition()<\/code>\u53ef\u4ee5\u5224\u5b9a\u4efb\u610f\u4f4d\u7f6e\u5173\u7cfb\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1284],"tags":[1416,1417,182,773,1400],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/8522"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=8522"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/8522\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=8522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=8522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=8522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}