{"id":168108,"date":"2024-05-08T16:16:57","date_gmt":"2024-05-08T08:16:57","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/168108.html"},"modified":"2024-05-08T16:17:04","modified_gmt":"2024-05-08T08:17:04","slug":"javascript-%e4%b8%ad%e7%9a%84%e5%9b%9e%e8%b0%83%e5%87%bd%e6%95%b0%e5%a6%82%e4%bd%95%e7%94%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/168108.html","title":{"rendered":"JavaScript \u4e2d\u7684\u56de\u8c03\u51fd\u6570\u5982\u4f55\u7528"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27034229\/57d91c50-7576-40dc-bef9-2d5b09e305c7.webp\" alt=\"JavaScript \u4e2d\u7684\u56de\u8c03\u51fd\u6570\u5982\u4f55\u7528\" \/><\/p>\n<p><p>JavaScript \u4e2d\u7684\u56de\u8c03\u51fd\u6570\u7528\u4e8e\u5728\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u540e\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u7247\u6bb5\u3001\u7528\u4e8e\u5f02\u6b65\u7f16\u7a0b\u3001\u63d0\u9ad8\u5e94\u7528\u6027\u80fd\u3002\u56de\u8c03\u51fd\u6570\u6781\u5927\u5730\u589e\u5f3a\u4e86JavaScript\u7684\u7075\u6d3b\u6027\u548c\u529f\u80fd\u5f3a\u5927\uff0c\u7279\u522b\u662f\u5728\u5904\u7406\u5f02\u6b65\u64cd\u4f5c\uff0c\u5982\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u6570\u636e\u65f6\u3002\u5f53\u6267\u884c\u65f6\u95f4\u6d88\u8d39\u64cd\u4f5c\u6216\u5f02\u6b65\u8bf7\u6c42\u65f6\uff0c\u4f60\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\uff0cJavaScript\u8fd0\u884c\u65f6\u4f1a\u5728\u9002\u5f53\u7684\u65f6\u5019\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\uff0c\u800c\u4e0d\u4f1a\u963b\u585e\u4ee3\u7801\u6267\u884c\uff0c\u4ece\u800c\u63d0\u9ad8\u5e94\u7528\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u7406\u89e3\u56de\u8c03\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u56de\u8c03\u51fd\u6570\u662f\u5728JavaScript\u4e2d\u4f7f\u7528\u975e\u5e38\u5e7f\u6cdb\u7684\u4e00\u79cd\u7f16\u7a0b\u6a21\u5f0f\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\u662f\u4e00\u4e2a\u88ab\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u7684\u51fd\u6570\uff0c\u5e76\u4e14\u5728\u9002\u5f53\u7684\u65f6\u5019\u88ab\u8c03\u7528\u3002\u5728JavaScript\u4e2d\uff0c\u56e0\u4e3a\u51fd\u6570\u88ab\u89c6\u4e3a\u4e00\u7b49\u516c\u6c11\uff08\u5373\u5b83\u4eec\u53ef\u4ee5\u50cf\u4efb\u4f55\u5176\u4ed6\u5bf9\u8c61\u4e00\u6837\u88ab\u4f20\u9012\u548c\u64cd\u4f5c\uff09\uff0c\u56de\u8c03\u6a21\u5f0f\u7279\u522b\u7684\u6709\u7528\u548c\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u540c\u6b65\u56de\u8c03<\/h3>\n<\/p>\n<p><p>\u5728\u540c\u6b65\u64cd\u4f5c\u4e2d\uff0c\u56de\u8c03\u51fd\u6570\u53ef\u4ee5\u7528\u6765\u5728\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u4e4b\u540e\u7acb\u5373\u6267\u884c\u67d0\u4e9b\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5728\u6570\u7ec4\u7684<code>.forEach<\/code>\u65b9\u6cd5\u4e2d\u5c31\u4f7f\u7528\u4e86\u56de\u8c03\u51fd\u6570\uff0c\u6765\u5bf9\u6570\u7ec4\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u6267\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const fruits = [&#039;apple&#039;, &#039;banana&#039;, &#039;cherry&#039;];<\/p>\n<p>fruits.forEach(function (item, index) {<\/p>\n<p>    console.log(index, item);<\/p>\n<p>});<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>forEach<\/code>\u63a5\u6536\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\uff0c\u8be5\u51fd\u6570\u5bf9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u6253\u5370\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5f02\u6b65\u56de\u8c03<\/h3>\n<\/p>\n<p><p>\u5f02\u6b65\u56de\u8c03\u66f4\u662fJavaScript\u7f16\u7a0b\u4e2d\u7684\u4e00\u5927\u7279\u8272\uff0c\u7279\u522b\u662f\u5728\u5904\u7406I\/O\u5bc6\u96c6\u578b\u4efb\u52a1\u5982\u7f51\u7edc\u8bf7\u6c42\u65f6\u3002\u4e00\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\u662f\u4f7f\u7528<code>XMLHttpRequest<\/code>\u5bf9\u8c61\u53d1\u8d77HTTP\u8bf7\u6c42\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">function getData(url, callback) {<\/p>\n<p>    const xhr = new XMLHttpRequest();<\/p>\n<p>    xhr.onreadystatechange = function() {<\/p>\n<p>        if (xhr.readyState === 4) {<\/p>\n<p>            if (xhr.status === 200) {<\/p>\n<p>                callback(null, xhr.responseText);<\/p>\n<p>            } else {<\/p>\n<p>                callback(xhr.status, null);<\/p>\n<p>            }<\/p>\n<p>        }<\/p>\n<p>    };<\/p>\n<p>    xhr.open(&#039;GET&#039;, url);<\/p>\n<p>    xhr.send();<\/p>\n<p>}<\/p>\n<p>getData(&#039;https:\/\/api.example.com\/data&#039;, function (err, data) {<\/p>\n<p>    if (err) {<\/p>\n<p>        \/\/ \u5904\u7406\u9519\u8bef<\/p>\n<p>        console.error(err);<\/p>\n<p>    } else {<\/p>\n<p>        \/\/ \u5904\u7406\u6570\u636e<\/p>\n<p>        console.log(data);<\/p>\n<p>    }<\/p>\n<p>});<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c<code>getData<\/code>\u51fd\u6570\u53d1\u51fa\u4e86\u4e00\u4e2aGET\u8bf7\u6c42\u3002\u4e00\u65e6\u670d\u52a1\u5668\u54cd\u5e94\uff0c\u4fbf\u4f1a\u8c03\u7528\u4f20\u5165\u7684\u56de\u8c03\u51fd\u6570\uff0c\u5e76\u6839\u636e\u54cd\u5e94\u7684\u72b6\u6001\u4f20\u9012\u9519\u8bef\u6216\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u56de\u8c03\u5730\u72f1\u548c\u89e3\u51b3\u65b9\u6848<\/h3>\n<\/p>\n<p><p>\u6df1\u5c42\u5d4c\u5957\u7684\u56de\u8c03\uff08\u4fd7\u79f0\u56de\u8c03\u5730\u72f1\uff09\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4ee3\u7801\u96be\u4ee5\u7406\u89e3\u548c\u7ef4\u62a4\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">login(username, password, function (err, user) {<\/p>\n<p>    if (err) {<\/p>\n<p>        \/\/ \u5904\u7406\u767b\u5f55\u9519\u8bef<\/p>\n<p>    } else {<\/p>\n<p>        getUserSettings(user, function (err, settings) {<\/p>\n<p>            if (err) {<\/p>\n<p>                \/\/ \u5904\u7406\u83b7\u53d6\u8bbe\u7f6e\u9519\u8bef<\/p>\n<p>            } else {<\/p>\n<p>                renderDashboard(user, settings, function (err) {<\/p>\n<p>                    if (err) {<\/p>\n<p>                        \/\/ \u5904\u7406\u6e32\u67d3\u4eea\u8868\u677f\u9519\u8bef<\/p>\n<p>                    }<\/p>\n<p>                });<\/p>\n<p>            }<\/p>\n<p>        });<\/p>\n<p>    }<\/p>\n<p>});<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u591a\u4e2a\u5c42\u7ea7\u7684\u56de\u8c03\u5d4c\u5957\u3002<strong>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u79cd\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Promise<\/code>\u6216\u8005<code>async\/aw<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>t<\/code>\u6765\u4f7f\u5f02\u6b65\u4ee3\u7801\u66f4\u52a0\u6241\u5e73\u5316\u548c\u6613\u4e8e\u7ef4\u62a4\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528Promise\u4f18\u5316\u5f02\u6b65\u56de\u8c03<\/h3>\n<\/p>\n<p><p><code>Promise<\/code>\u662f\u5f02\u6b65\u7f16\u7a0b\u7684\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u4ee3\u8868\u4e86\u4e00\u4e2a\u5c1a\u672a\u5b8c\u6210\u4f46\u9884\u8ba1\u5c06\u6765\u4f1a\u5b8c\u6210\u7684\u64cd\u4f5c\u7684\u7ed3\u679c\u3002\u7528<code>Promises<\/code>\u91cd\u5199\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">login(username, password).then(user =&gt; {<\/p>\n<p>    return getUserSettings(user);<\/p>\n<p>}).then(settings =&gt; {<\/p>\n<p>    return renderDashboard(user, settings);<\/p>\n<p>}).catch(err =&gt; {<\/p>\n<p>    \/\/ \u65b9\u4fbf\u5730\u6355\u6349\u4efb\u4f55\u5728\u94fe\u4e2d\u7684\u9519\u8bef<\/p>\n<p>    console.error(err);<\/p>\n<p>});<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528<code>Promises<\/code>\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u5f02\u6b65\u4ee3\u7801\u7684\u7ed3\u6784\uff0c\u4f7f\u5176\u66f4\u6613\u4e8e\u9605\u8bfb\u548c\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528async\/await\u4f18\u5316\u5f02\u6b65\u56de\u8c03<\/h3>\n<\/p>\n<p><p>ES2017\u5f15\u5165\u4e86<code>async<\/code>\u51fd\u6570\u548c<code>await<\/code>\u5173\u952e\u5b57\uff0c\u4f7f\u5f97\u5f02\u6b65\u64cd\u4f5c\u7684\u7f16\u5199\u66f4\u52a0\u63a5\u8fd1\u540c\u6b65\u64cd\u4f5c\uff0c\u8fdb\u4e00\u6b65\u7b80\u5316\u4e86Promise\u7684\u4f7f\u7528\u3002\u91cd\u5199\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u4f7f\u7528<code>async\/await<\/code>\u53d8\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">async function initializeDashboard() {<\/p>\n<p>    try {<\/p>\n<p>        const user = await login(username, password);<\/p>\n<p>        const settings = await getUserSettings(user);<\/p>\n<p>        await renderDashboard(user, settings);<\/p>\n<p>    } catch (err) {<\/p>\n<p>        console.error(err);<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>initializeDashboard();<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5229\u7528<code>async\/await<\/code>\u53ef\u4ee5\u5199\u51fa\u975e\u5e38\u6e05\u6670\u548c\u76f4\u89c2\u7684\u5f02\u6b65\u4ee3\u7801<\/strong>\uff0c\u540c\u65f6\u4fdd\u6301\u4e86\u5f02\u6b65\u64cd\u4f5c\u7684\u6240\u6709\u4f18\u52bf\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u56de\u8c03\u51fd\u6570\u7684\u5176\u4ed6\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>\u56de\u8c03\u51fd\u6570\u7684\u5e94\u7528\u4e0d\u4ec5\u4ec5\u5c40\u9650\u4e8e\u6570\u7ec4\u65b9\u6cd5\u6216\u5f02\u6b65\u7f16\u7a0b\uff0c\u5b83\u5728\u8bb8\u591aJavaScript\u5e93\u548c\u6846\u67b6\u4e2d\u90fd\u6709\u7740\u5e7f\u6cdb\u7684\u7528\u9014\u3002\u4f8b\u5982\uff0c\u5728Node.js\u4e2d\uff0c\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f16\u7a0b\u6a21\u578b\u5c31\u4f9d\u8d56\u4e8e\u56de\u8c03\u51fd\u6570\u7684\u4f7f\u7528\u3002\u5728\u524d\u7aef\u5f00\u53d1\u4e2d\uff0c\u64cd\u4f5cDOM\u5143\u7d20\u65f6\u7ecf\u5e38\u9700\u8981\u7ed1\u5b9a\u4e8b\u4ef6\u5904\u7406\u5668\uff0c\u8fd9\u4e9b\u5904\u7406\u5668\u4e5f\u662f\u56de\u8c03\u51fd\u6570\u7684\u5f62\u5f0f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u4f7f\u7528 JavaScript \u4e2d\u7684\u56de\u8c03\u51fd\u6570\uff1f<\/strong><\/p>\n<p>\u56de\u8c03\u51fd\u6570\u662f JavaScript \u4e2d\u4e00\u79cd\u5e38\u7528\u7684\u7f16\u7a0b\u6280\u672f\uff0c\u7528\u4e8e\u5728\u5f02\u6b65\u64cd\u4f5c\u5b8c\u6210\u540e\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u51e0\u4e2a\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u7684\u793a\u4f8b\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5982\u4f55\u5728\u4e8b\u4ef6\u5904\u7406\u4e2d\u4f7f\u7528\u56de\u8c03\u51fd\u6570\uff1f<\/strong><\/p>\n<p>\u5f53\u7528\u6237\u89e6\u53d1\u67d0\u4e2a\u4e8b\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a onClick \u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u6309\u94ae\u7684\u70b9\u51fb\u4e8b\u4ef6\u3002\u5f53\u6309\u94ae\u88ab\u70b9\u51fb\u65f6\uff0c\u8be5\u56de\u8c03\u51fd\u6570\u5c06\u88ab\u6267\u884c\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-javascript\">button.addEventListener(&#039;click&#039;, onClick);\n\nfunction onClick() {\n  \/\/ \u5728\u6b64\u5904\u7f16\u5199\u70b9\u51fb\u4e8b\u4ef6\u7684\u5904\u7406\u903b\u8f91\n}\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5982\u4f55\u5728\u5f02\u6b65\u64cd\u4f5c\u4e2d\u4f7f\u7528\u56de\u8c03\u51fd\u6570\uff1f<\/strong><\/p>\n<p>\u5f02\u6b65\u64cd\u4f5c\u9700\u8981\u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u83b7\u53d6\u7ed3\u679c\uff0c\u8fd9\u65f6\u53ef\u4ee5\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u5f02\u6b65\u64cd\u4f5c\u7684\u7ed3\u679c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728 AJAX \u8bf7\u6c42\u5b8c\u6210\u540e\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u8fd4\u56de\u7684\u6570\u636e\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-javascript\">function fetchData(callback) {\n  \/\/ \u5f02\u6b65\u64cd\u4f5c\u7684\u4ee3\u7801\uff0c\u5728\u64cd\u4f5c\u5b8c\u6210\u540e\u6267\u884c\u56de\u8c03\u51fd\u6570\n  setTimeout(function() {\n    const data = &#039;\u8fd9\u662f\u8fd4\u56de\u7684\u6570\u636e&#039;;\n    callback(data); \/\/ \u8c03\u7528\u56de\u8c03\u51fd\u6570\uff0c\u5e76\u5c06\u6570\u636e\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u56de\u8c03\u51fd\u6570\n  }, 1000);\n}\n\nfetchData(function(data) {\n  \/\/ \u5728\u6b64\u5904\u5904\u7406\u8fd4\u56de\u7684\u6570\u636e\n  console.log(data);\n});\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5982\u4f55\u5904\u7406\u5f02\u6b65\u64cd\u4f5c\u7684\u9519\u8bef\uff1f<\/strong><\/p>\n<p>\u5728\u5f02\u6b65\u64cd\u4f5c\u4e2d\uff0c\u53ef\u80fd\u4f1a\u53d1\u751f\u9519\u8bef\u3002\u4e3a\u4e86\u6355\u83b7\u548c\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\uff0c\u53ef\u4ee5\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a onError \u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u5f02\u6b65\u64cd\u4f5c\u7684\u9519\u8bef\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-javascript\">function fetchData(callback, errorCallback) {\n  \/\/ \u5f02\u6b65\u64cd\u4f5c\u7684\u4ee3\u7801\uff0c\u5728\u64cd\u4f5c\u5b8c\u6210\u540e\u6267\u884c\u56de\u8c03\u51fd\u6570\n  setTimeout(function() {\n    const data = null; \/\/ \u6a21\u62df\u4e00\u4e2a\u9519\u8bef\u7684\u60c5\u51b5\n    if (data) {\n      callback(data);\n    } else {\n      errorCallback(&#039;\u53d1\u751f\u9519\u8bef&#039;);\n    }\n  }, 1000);\n}\n\nfetchData(function(data) {\n  \/\/ \u5728\u6b64\u5904\u5904\u7406\u8fd4\u56de\u7684\u6570\u636e\n  console.log(data);\n}, function(error) {\n  \/\/ \u5728\u6b64\u5904\u5904\u7406\u9519\u8bef\n  console.error(error);\n});\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u662f\u56de\u8c03\u51fd\u6570\u5728 JavaScript \u4e2d\u7684\u4f7f\u7528\u793a\u4f8b\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"JavaScript \u4e2d\u7684\u56de\u8c03\u51fd\u6570\u7528\u4e8e\u5728\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u540e\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u7247\u6bb5\u3001\u7528\u4e8e\u5f02\u6b65\u7f16\u7a0b\u3001\u63d0\u9ad8\u5e94\u7528\u6027\u80fd\u3002\u56de\u8c03\u51fd\u6570 [&hellip;]","protected":false},"author":3,"featured_media":168118,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/168108"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=168108"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/168108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/168118"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=168108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=168108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=168108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}