{"id":41209,"date":"2025-06-01T00:16:15","date_gmt":"2025-05-31T16:16:15","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/41209.html"},"modified":"2025-06-01T00:16:15","modified_gmt":"2025-05-31T16:16:15","slug":"%e3%80%90javascript%e3%80%91ajax-%e4%be%a0%e5%ae%a2%e8%a1%8c%ef%bc%9aaxios-%e8%bd%bb%e5%8a%9f%e7%a9%bf%e6%a2%ad%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%97%b4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/41209.html","title":{"rendered":"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4"},"content":{"rendered":"<h2 style=\"background-color:transparent\">\u4e00\u3001AJAX \u6982\u5ff5\u548c axios \u4f7f\u7528\u8bb2\u89e3<\/h2>\n<p style=\"background-color:transparent\"><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f AJAX ?\u00a0<\/span><\/span><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u6d4f\u89c8\u5668\u7684<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> XMLHttpRequest <\/span><\/span>\u5bf9\u8c61\u4e0e<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u670d\u52a1\u5668\u901a\u4fe1<\/span><\/span><\/p>\n<\/li>\n<li>\n<p>\u6d4f\u89c8\u5668\u7f51\u9875\u4e2d&#xff0c;\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> AJAX\u6280\u672f&#xff08;XHR\u5bf9\u8c61&#xff09;<\/span><\/span>\u53d1\u8d77\u83b7\u53d6\u7701\u4efd\u5217\u8868\u6570\u636e\u7684\u8bf7\u6c42&#xff0c;\u670d\u52a1\u5668\u4ee3\u7801\u54cd\u5e94\u51c6\u5907\u597d\u7684\u7701\u4efd\u5217\u8868\u6570\u636e\u7ed9\u524d\u7aef&#xff0c;\u524d\u7aef\u62ff\u5230\u6570\u636e\u6570\u7ec4\u4ee5\u540e&#xff0c;\u5c55\u793a\u5230\u7f51\u9875<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"300\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4c93c5a.png\" width=\"809\" \/>\u200b<\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f\u670d\u52a1\u5668&#xff1f;<\/span><\/span><\/p>\n<ul>\n<li>\u53ef\u4ee5\u6682\u65f6\u7406\u89e3\u4e3a\u63d0\u4f9b\u6570\u636e\u7684\u4e00\u53f0\u7535\u8111<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4e3a\u4f55\u5b66 AJAX ?<\/span><\/span><\/p>\n<ul>\n<li>\u4ee5\u524d\u6211\u4eec\u7684\u6570\u636e\u90fd\u662f\u5199\u5728\u4ee3\u7801\u91cc\u56fa\u5b9a\u7684, \u65e0\u6cd5\u968f\u65f6\u53d8\u5316<\/li>\n<li>\u73b0\u5728\u6211\u4eec\u7684\u6570\u636e\u53ef\u4ee5\u4ece\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u83b7\u53d6&#xff0c;\u8ba9\u6570\u636e\u53d8\u6d3b<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4f53\u9a8c axios \u8bed\u6cd5\u7684\u4f7f\u7528\u00a0<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u7701\u4efd\u5217\u8868\u6570\u636e&#xff0c;\u5c55\u793a\u5230\u9875\u9762\u4e0a<\/p>\n<p>\u83b7\u53d6\u7701\u4efd\u5217\u8868\u6570\u636e &#8211; <span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u76ee\u6807\u8d44\u6e90\u5730\u5740<\/span><\/span>&#xff1a;http:\/\/hmajax.itheima.net\/api\/province<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5b8c\u6210\u6548\u679c&#xff1a;<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"498\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4cae6e0.png\" width=\"837\" \/>\u200b<\/p>\n<p>\u00a0<span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u00a0axios \u8bed\u6cd5&#xff0c;\u6b65\u9aa4&#xff1a;<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u5f15\u5165 ax\u00a0ios.js \u6587\u4ef6\u5230\u81ea\u5df1\u7684\u7f51\u9875\u4e2d<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">axios.js\u6587\u4ef6\u94fe\u63a5<\/span><\/span>: https:\/\/cdn.jsdelivr.net\/npm\/axios\/dist\/axios.min.js<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u660e\u786eaxios\u51fd\u6570\u7684\u00a0\u4f7f\u7528\u8bed\u6cd5<\/span><\/span><\/p>\n<p> axios({<br \/>\n  url: &#039;\u76ee\u6807\u8d44\u6e90\u5730\u5740&#039;<br \/>\n}).then((result) &#061;&gt; {<br \/>\n  \/\/ \u5bf9\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\u505a\u540e\u7eed\u5904\u7406<br \/>\n})<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u5bf9\u5e94\u4ee3\u7801<\/span><\/span><\/p>\n<p> &lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<\/p>\n<p>&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;meta http-equiv&#061;&#034;X-UA-Compatible&#034; content&#061;&#034;IE&#061;edge&#034;&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n  &lt;title&gt;AJAX\u6982\u5ff5\u548caxios\u4f7f\u7528&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n  &lt;!&#8211;<br \/>\n    axios\u5e93\u5730\u5740&#xff1a;https:\/\/cdn.jsdelivr.net\/npm\/axios\/dist\/axios.min.js<br \/>\n    \u7701\u4efd\u6570\u636e\u5730\u5740&#xff1a;http:\/\/hmajax.itheima.net\/api\/province<\/p>\n<p>    \u76ee\u6807: \u4f7f\u7528axios\u5e93, \u83b7\u53d6\u7701\u4efd\u5217\u8868\u6570\u636e, \u5c55\u793a\u5230\u9875\u9762\u4e0a<br \/>\n    1. \u5f15\u5165axios\u5e93<br \/>\n  &#8211;&gt;<br \/>\n  &lt;p class&#061;&#034;my-p&#034;&gt;&lt;\/p&gt;<br \/>\n  &lt;script src&#061;&#034;https:\/\/cdn.jsdelivr.net\/npm\/axios\/dist\/axios.min.js&#034;&gt;&lt;\/script&gt;<br \/>\n  &lt;script&gt;<br \/>\n    \/\/ 2. \u4f7f\u7528axios\u51fd\u6570<br \/>\n    axios({<br \/>\n      url: &#039;http:\/\/hmajax.itheima.net\/api\/province&#039;<br \/>\n    }).then(result &#061;&gt; {<br \/>\n      console.log(result)<br \/>\n      \/\/ \u597d\u4e60\u60ef&#xff1a;\u591a\u6253\u5370&#xff0c;\u786e\u8ba4\u5c5e\u6027\u540d<br \/>\n      console.log(result.data.list)<br \/>\n      console.log(result.data.list.join(&#039;&lt;br&gt;&#039;))<br \/>\n      \/\/ \u628a\u51c6\u5907\u597d\u7701\u4efd\u5217\u8868&#xff0c;\u63d2\u5165\u5230\u9875\u9762<br \/>\n      document.querySelector(&#039;.my-p&#039;).innerHTML &#061; result.data.list.join(&#039;&lt;br&gt;&#039;)<br \/>\n    })<br \/>\n  &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<h4><\/h4>\n<h2 style=\"background-color:transparent\">\u4e8c\u3001\u8ba4\u8bc6 URL<\/h2>\n<p style=\"background-color:transparent\"><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4e3a\u4ec0\u4e48\u8981\u8ba4\u8bc6 URL ?<\/span><\/span>\u00a0mdn<\/p>\n<\/p>\n<p>\u867d\u7136\u662f\u540e\u7aef\u7ed9\u6211\u7684\u4e00\u4e2a\u5730\u5740&#xff0c;\u4f46\u662f\u54ea\u90e8\u5206\u6807\u8bb0\u7684\u662f\u670d\u52a1\u5668\u7535\u8111&#xff0c;\u54ea\u90e8\u5206\u6807\u8bb0\u7684\u662f\u8d44\u6e90\u5462&#xff1f;<\/p>\n<p>\u6240\u4ee5<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u4e3a\u4e86\u548c\u670d\u52a1\u5668\u6709\u6548\u6c9f\u901a<\/span><\/span>\u6211\u4eec\u8981\u8ba4\u8bc6\u4e00\u4e0b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f URL &#xff1f;<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u7edf\u4e00\u8d44\u6e90\u5b9a\u4f4d\u7b26<\/span><\/span>&#xff0c;\u7b80\u79f0<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u7f51\u5740<\/span><\/span>&#xff0c;\u7528\u4e8e<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u5b9a\u4f4d\u7f51\u7edc\u4e2d\u7684\u8d44\u6e90<\/span><\/span><\/p>\n<p>&#xff08;\u8d44\u6e90\u6307\u7684\u662f&#xff1a;\u7f51\u9875&#xff0c;\u56fe\u7247&#xff0c;\u6570\u636e&#xff0c;\u89c6\u9891&#xff0c;\u97f3\u9891\u7b49\u7b49&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"97\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4cd134d.png\" width=\"1084\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">URL \u7684\u7ec4\u6210?<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u534f\u8bae<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u57df\u540d<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8d44\u6e90\u8def\u5f84<\/span><\/span>&#xff08;URL \u7ec4\u6210\u6709\u5f88\u591a\u90e8\u5206&#xff0c;\u6211\u4eec\u5148\u638c\u63e1\u8fd93\u4e2a\u91cd\u8981\u7684\u90e8\u5206\u5373\u53ef&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"451\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4ce62b9.png\" width=\"669\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f http \u534f\u8bae ?<\/span><\/span><\/p>\n<p>\u53eb<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae<\/span><\/span>&#xff0c;\u89c4\u5b9a\u4e86<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u4f20\u9012\u6570\u636e\u7684\u683c\u5f0f<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"418\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4d0345b.png\" width=\"754\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f\u57df\u540d ?<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6807\u8bb0\u670d\u52a1\u5668\u5728\u4e92\u8054\u7f51\u5f53\u4e2d\u7684\u65b9\u4f4d<\/span><\/span><\/p>\n<p>\u7f51\u7edc\u4e2d\u6709\u5f88\u591a\u670d\u52a1\u5668&#xff0c;\u4f60\u60f3\u8bbf\u95ee\u54ea\u4e00\u53f0&#xff0c;\u5c31\u9700\u8981\u77e5\u9053\u5b83\u7684\u57df\u540d\u624d\u53ef\u4ee5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"455\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4d138a0.png\" width=\"737\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f\u8d44\u6e90\u8def\u5f84 ?<\/span><\/span><\/p>\n<p>\u4e00\u4e2a\u670d\u52a1\u5668\u5185\u6709\u591a\u4e2a\u8d44\u6e90&#xff0c;\u7528\u4e8e<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6807\u8bc6\u4f60\u8981\u8bbf\u95ee\u7684\u8d44\u6e90\u5177\u4f53\u7684\u4f4d\u7f6e<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"483\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4d24e4a.png\" width=\"726\" \/>\u200b<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u8bbf\u95ee\u65b0\u95fb\u5217\u8868\u7684 URL \u7f51\u5740&#xff0c;\u6253\u5370\u65b0\u95fb\u6570\u636e<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"382\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4d36f0f.png\" width=\"1653\" \/><\/span><\/span>\u200b<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u65b0\u95fb\u5217\u8868\u6570\u636e URL \u7f51\u5740<\/span><\/span>&#xff1a;http:\/\/hmajax.itheima.net\/api\/news<\/p>\n<p> axios({<br \/>\n  url: &#039;http:\/\/hmajax.itheima.net\/api\/news&#039;<br \/>\n}).then(result &#061;&gt; {<br \/>\n  console.log(result)<br \/>\n})<\/p>\n<p>url\u89e3\u91ca&#xff1a;\u4ece\u9ed1\u9a6c\u670d\u52a1\u5668\u4f7f\u7528http\u534f\u8bae&#xff0c;\u8bbf\u95ee\/api\/news\u8def\u5f84\u4e0b\u7684\u65b0\u95fb\u5217\u8868\u8d44\u6e90<\/p>\n<h2 style=\"background-color:transparent\">\u4e09\u3001URL \u67e5\u8be2\u53c2\u6570<\/h2>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u662f\u67e5\u8be2\u53c2\u6570 ?<\/span><\/span><\/p>\n<ul>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u643a\u5e26\u7ed9\u670d\u52a1\u5668\u989d\u5916\u4fe1\u606f<\/span><\/span>&#xff0c;\u8ba9\u670d\u52a1\u5668\u8fd4\u56de\u6211\u60f3\u8981\u7684\u67d0\u4e00\u90e8\u5206\u6570\u636e\u800c\u4e0d\u662f\u5168\u90e8\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u4e3e\u4f8b&#xff1a;\u67e5\u8be2\u6cb3\u5317\u7701\u4e0b\u5c5e\u7684\u57ce\u5e02\u5217\u8868&#xff0c;\u9700\u8981\u5148\u628a\u6cb3\u5317\u7701\u4f20\u9012\u7ed9\u670d\u52a1\u5668<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"247\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4d8455e.png\" width=\"1131\" \/>\u200b<\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u67e5\u8be2\u53c2\u6570\u7684\u8bed\u6cd5 &#xff1f;<\/span><\/span><\/p>\n<ul>\n<li>\u5728 url \u7f51\u5740\u540e\u9762\u7528?\u00a0<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u62fc\u63a5\u683c\u5f0f&#xff1a;<\/span><\/span>http:\/\/xxxx.com\/xxx\/xxx?\u53c2\u6570\u540d1&#061;\u503c1&amp;\u53c2\u6570\u540d2&#061;\u503c2<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u53c2\u6570\u540d\u4e00\u822c\u662f\u540e\u7aef\u89c4\u5b9a\u7684<\/span><\/span>&#xff0c;\u503c\u524d\u7aef\u770b\u60c5\u51b5\u4f20\u9012\u5373\u53ef<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">axios \u5982\u4f55\u643a\u5e26\u67e5\u8be2\u53c2\u6570?<\/span><\/span><\/p>\n<p>\u4f7f\u7528 params \u9009\u9879\u5373\u53ef<\/p>\n<p> axios({<br \/>\n  url: &#039;\u76ee\u6807\u8d44\u6e90\u5730\u5740&#039;,<br \/>\n  params: {<br \/>\n    \u53c2\u6570\u540d: \u503c<br \/>\n  }<br \/>\n}).then(result &#061;&gt; {<br \/>\n  \/\/ \u5bf9\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\u505a\u540e\u7eed\u5904\u7406<br \/>\n})<\/p>\n<p>\u67e5\u8be2\u57ce\u5e02\u5217\u8868\u7684 <span style=\"color:#fe2c24\"><span style=\"background-color:#fff5e6\">url\u5730\u5740<\/span><\/span>&#xff1a;http:\/\/hmajax.itheima.net\/api\/city<\/p>\n<p>\u53c2\u6570\u540d&#xff1a;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">pname <\/span><\/span>&#xff08;\u503c\u8981\u643a\u5e26\u7701\u4efd\u540d\u5b57&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42<\/span><\/span>&#xff1a;\u83b7\u53d6\u201c\u6cb3\u5317\u7701\u201d\u4e0b\u5c5e\u7684\u57ce\u5e02\u5217\u8868&#xff0c;\u5c55\u793a\u5230\u9875\u9762&#xff0c;\u5bf9\u5e94\u4ee3\u7801&#xff1a;<\/p>\n<p> &lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<br \/>\n&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;meta http-equiv&#061;&#034;X-UA-Compatible&#034; content&#061;&#034;IE&#061;edge&#034;&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n  &lt;title&gt;\u67e5\u8be2\u53c2\u6570&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n  &lt;!&#8211;<br \/>\n    \u57ce\u5e02\u5217\u8868: http:\/\/hmajax.itheima.net\/api\/city<br \/>\n    \u53c2\u6570\u540d: pname<br \/>\n    \u503c: \u7701\u4efd\u540d\u5b57<br \/>\n  &#8211;&gt;<br \/>\n  &lt;p&gt;&lt;\/p&gt;<br \/>\n  &lt;script src&#061;&#034;https:\/\/cdn.jsdelivr.net\/npm\/axios\/dist\/axios.min.js&#034;&gt;&lt;\/script&gt;<br \/>\n  &lt;script&gt;<br \/>\n    axios({<br \/>\n      url: &#039;http:\/\/hmajax.itheima.net\/api\/city&#039;,<br \/>\n      \/\/ \u67e5\u8be2\u53c2\u6570<br \/>\n      params: {<br \/>\n        pname: &#039;\u8fbd\u5b81\u7701&#039;<br \/>\n      }<br \/>\n    }).then(result &#061;&gt; {<br \/>\n      console.log(result.data.list)<br \/>\n      document.querySelector(&#039;p&#039;).innerHTML &#061; result.data.list.join(&#039;&lt;br&gt;&#039;)<br \/>\n    })<br \/>\n  &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<h4><\/h4>\n<h2>\u56db\u3001\u6848\u4f8b-\u67e5\u8be2-\u5730\u533a\u5217\u8868<\/h2>\n<h4><\/h4>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u6839\u636e\u8f93\u5165\u7684\u7701\u4efd\u540d\u5b57\u548c\u57ce\u5e02\u540d\u5b57&#xff0c;\u67e5\u8be2\u4e0b\u5c5e\u5730\u533a\u5217\u8868<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5b8c\u6210\u6548\u679c\u5982\u4e0b&#xff1a;<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"448\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4da371a.png\" width=\"902\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u76f8\u5173\u53c2\u6570<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u67e5\u8be2\u5730\u533a<\/span><\/span>: http:\/\/hmajax.itheima.net\/api\/area<\/p>\n<p>\u53c2\u6570\u540d&#xff1a;<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">pname<\/span><\/span>&#xff1a;\u7701\u4efd\u540d\u5b57<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">cname<\/span><\/span>&#xff1a;\u57ce\u5e02\u540d\u5b57<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u6b63\u786e\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/span><\/span><\/p>\n<p> \/*<br \/>\n      \u83b7\u53d6\u5730\u533a\u5217\u8868: http:\/\/hmajax.itheima.net\/api\/area<br \/>\n      \u67e5\u8be2\u53c2\u6570:<br \/>\n        pname: \u7701\u4efd\u6216\u76f4\u8f96\u5e02\u540d\u5b57<br \/>\n        cname: \u57ce\u5e02\u540d\u5b57<br \/>\n    *\/<br \/>\n\/\/ \u76ee\u6807: \u6839\u636e\u7701\u4efd\u548c\u57ce\u5e02\u540d\u5b57, \u67e5\u8be2\u5730\u533a\u5217\u8868<br \/>\n\/\/ 1. \u67e5\u8be2\u6309\u94ae-\u70b9\u51fb\u4e8b\u4ef6<br \/>\ndocument.querySelector(&#039;.sel-btn&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n    \/\/ 2. \u83b7\u53d6\u7701\u4efd\u548c\u57ce\u5e02\u540d\u5b57<br \/>\n    let pname &#061; document.querySelector(&#039;.province&#039;).value<br \/>\n    let cname &#061; document.querySelector(&#039;.city&#039;).value<\/p>\n<p>    \/\/ 3. \u57fa\u4e8eaxios\u8bf7\u6c42\u5730\u533a\u5217\u8868\u6570\u636e<br \/>\n    axios({<br \/>\n        url: &#039;http:\/\/hmajax.itheima.net\/api\/area&#039;,<br \/>\n        params: {<br \/>\n            pname,<br \/>\n            cname<br \/>\n        }<br \/>\n    }).then(result &#061;&gt; {<br \/>\n        \/\/ console.log(result)<br \/>\n        \/\/ 4. \u628a\u6570\u636e\u8f6cli\u6807\u7b7e\u63d2\u5165\u5230\u9875\u9762\u4e0a<br \/>\n        let list &#061; result.data.list<br \/>\n        console.log(list)<br \/>\n        let theLi &#061; list.map(areaName &#061;&gt; &#096;&lt;li class&#061;&#034;list-group-item&#034;&gt;${areaName}&lt;\/li&gt;&#096;).join(&#039;&#039;)<br \/>\n        console.log(theLi)<br \/>\n        document.querySelector(&#039;.list-group&#039;).innerHTML &#061; theLi<br \/>\n    })<br \/>\n})<\/p>\n<h4><\/h4>\n<h2 style=\"background-color:transparent\">\u4e94\u3001\u5e38\u7528\u8bf7\u6c42\u65b9\u6cd5\u548c\u6570\u636e\u63d0\u4ea4<\/h2>\n<h4><\/h4>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u60f3\u8981\u63d0\u4ea4\u6570\u636e&#xff0c;\u5148\u6765\u4e86\u89e3\u4ec0\u4e48\u662f\u8bf7\u6c42\u65b9\u6cd5<\/span><\/span><\/p>\n<p>\u8bf7\u6c42\u65b9\u6cd5\u662f\u4e00\u4e9b<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u56fa\u5b9a\u5355\u8bcd\u7684\u82f1\u6587<\/span><\/span>&#xff0c;\u4f8b\u5982&#xff1a;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">GET<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">POST<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">PUT<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">DELETE<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">PATCH<\/span><\/span><\/p>\n<p>&#xff08;\u8fd9\u4e9b\u90fd\u662fhttp\u534f\u8bae\u89c4\u5b9a\u7684&#xff09;&#xff0c;\u6bcf\u4e2a\u5355\u8bcd\u5bf9\u5e94\u4e00\u79cd\u5bf9\u670d\u52a1\u5668\u8d44\u6e90\u8981\u6267\u884c\u7684\u64cd\u4f5c<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"306\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4dc5083.png\" width=\"342\" \/>\u200b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"248\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4dd3181.png\" width=\"689\" \/>\u200b<\/p>\n<ul>\n<li>\u524d\u9762\u6211\u4eec\u83b7\u53d6\u6570\u636e\u5176\u5b9e\u7528\u7684\u5c31\u662f<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">GET\u8bf7\u6c42\u65b9\u6cd5<\/span><\/span>&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">axios<\/span><\/span>\u5185\u90e8\u8bbe\u7f6e\u4e86<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9ed8\u8ba4\u8bf7\u6c42\u65b9<\/span><\/span>\u6cd5\u5c31\u662fGET<\/li>\n<li>\u4f46\u662f<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u63d0\u4ea4\u6570\u636e<\/span><\/span>\u9700\u8981\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">POST\u8bf7\u6c42\u65b9\u6cd5<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ec0\u4e48\u65f6\u5019\u8fdb\u884c\u6570\u636e\u63d0\u4ea4\u5462&#xff1f;<\/span><\/span><\/p>\n<p>\u4f8b\u5982&#xff1a;\u591a\u7aef\u8981\u67e5\u770b\u540c\u4e00\u4efd\u8ba2\u5355\u6570\u636e&#xff0c;\u6216\u8005\u4f7f\u7528\u540c\u4e00\u4e2a\u8d26\u53f7\u8fdb\u884c\u767b\u5f55&#xff0c;\u90a3\u8ba2\u5355\/\u7528\u6237\u540d&#043;\u5bc6\u7801&#xff0c;\u5c31\u9700\u8981<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u4fdd\u5b58\u5728\u670d\u52a1\u5668\u4e0a<\/span><\/span>&#xff0c;\u968f\u65f6\u968f\u5730\u8fdb\u884c\u8bbf\u95ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"529\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161613-683b2b4ddf5c6.png\" width=\"1065\" \/>\u200b<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"860\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e2b1c1.png\" width=\"618\" \/><\/p>\n<p>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">axios \u5982\u4f55\u63d0\u4ea4\u6570\u636e\u5230\u670d\u52a1\u5668\u5462&#xff1f;<\/span><\/span><\/p>\n<p>\u9700\u8981\u5b66\u4e60&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">method <\/span><\/span>\u548c<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> data <\/span><\/span>\u8fd92\u4e2a\u65b0\u7684\u9009\u9879\u4e86<\/p>\n<p> axios({<br \/>\n  url: &#039;\u76ee\u6807\u8d44\u6e90\u5730\u5740&#039;,<br \/>\n  method: &#039;\u8bf7\u6c42\u65b9\u6cd5&#039;,<br \/>\n  data: {<br \/>\n    \u53c2\u6570\u540d: \u503c<br \/>\n  }<br \/>\n}).then(result &#061;&gt; {<br \/>\n  \/\/ \u5bf9\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\u505a\u540e\u7eed\u5904\u7406<br \/>\n})<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u6ce8\u518c\u8d26\u53f7&#xff0c;\u63d0\u4ea4\u7528\u6237\u540d\u548c\u5bc6\u7801\u5230\u670d\u52a1\u5668\u4fdd\u5b58<\/p>\n<p>\u6ce8\u518c\u7528\u6237 <span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">URL \u7f51\u5740<\/span><\/span>&#xff1a;http:\/\/hmajax.itheima.net\/api\/register<\/p>\n<p>\u8bf7\u6c42\u65b9\u6cd5&#xff1a;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">POST<\/span><\/span><\/p>\n<p>\u53c2\u6570\u540d&#xff1a;<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">username<\/span><\/span>&#xff1a;\u7528\u6237\u540d&#xff08;\u8981\u6c42\u4e2d\u82f1\u6587\u548c\u6570\u5b57\u7ec4\u6210&#xff0c;\u6700\u5c118\u4f4d&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">password<\/span><\/span>&#xff1a;\u5bc6\u7801&#xff08;\u6700\u5c116\u4f4d&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"247\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e47cbc.png\" width=\"1131\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u6b63\u786e\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/span><\/span><\/p>\n<p> \/*<br \/>\n  \u6ce8\u518c\u7528\u6237&#xff1a;http:\/\/hmajax.itheima.net\/api\/register<br \/>\n  \u8bf7\u6c42\u65b9\u6cd5&#xff1a;POST<br \/>\n  \u53c2\u6570\u540d&#xff1a;<br \/>\n    username&#xff1a;\u7528\u6237\u540d&#xff08;\u4e2d\u82f1\u6587\u548c\u6570\u5b57\u7ec4\u6210&#xff0c;\u6700\u5c118\u4f4d&#xff09;<br \/>\n    password&#xff1a;\u5bc6\u7801  &#xff08;\u6700\u5c116\u4f4d&#xff09;<\/p>\n<p>  \u76ee\u6807&#xff1a;\u70b9\u51fb\u6309\u94ae&#xff0c;\u901a\u8fc7axios\u63d0\u4ea4\u7528\u6237\u548c\u5bc6\u7801&#xff0c;\u5b8c\u6210\u6ce8\u518c<br \/>\n*\/<br \/>\ndocument.querySelector(&#039;.btn&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n  axios({<br \/>\n    url: &#039;http:\/\/hmajax.itheima.net\/api\/register&#039;,<br \/>\n    method: &#039;POST&#039;,<br \/>\n    data: {<br \/>\n      username: &#039;itheima007&#039;,<br \/>\n      password: &#039;7654321&#039;<br \/>\n    }<br \/>\n  })<br \/>\n})<\/p>\n<h4><\/h4>\n<h2>\u516d\u3001axios \u9519\u8bef\u5904\u7406<\/h2>\n<h4><\/h4>\n<p>\u5982\u679c\u6ce8\u518c\u76f8\u540c\u7684\u7528\u6237\u540d&#xff0c;\u5219\u4f1a\u9047\u5230<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6ce8\u518c\u5931\u8d25\u7684\u8bf7\u6c42<\/span><\/span>&#xff0c;\u4e5f\u5c31\u662f axios \u8bf7\u6c42\u54cd\u5e94\u5931\u8d25\u4e86&#xff0c;\u4f60\u4f1a\u5728\u63a7\u5236\u53f0\u770b\u5230\u5982\u56fe\u7684\u9519\u8bef&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"397\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e675f0.png\" width=\"565\" \/><\/p>\n<p>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5728 axios \u8bed\u6cd5\u4e2d\u8981\u5982\u4f55\u5904\u7406\u5462&#xff1f;<\/span><\/span><\/p>\n<p>\u56e0\u4e3a&#xff0c;\u666e\u901a\u7528\u6237\u4e0d\u4f1a\u53bb\u63a7\u5236\u53f0\u91cc\u770b\u9519\u8bef\u4fe1\u606f&#xff0c;\u6211\u4eec\u8981\u7f16\u5199\u4ee3\u7801<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u62ff\u5230\u9519\u8bef\u5e76\u5c55\u793a\u7ed9\u7528\u6237\u5728\u9875\u9762\u4e0a<\/span><\/span><\/p>\n<p>\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> axios <\/span><\/span>\u7684<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> catch <\/span><\/span>\u65b9\u6cd5&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6355\u83b7\u8fd9\u6b21\u8bf7\u6c42\u54cd\u5e94<\/span><\/span>\u7684\u9519\u8bef\u5e76\u505a\u540e\u7eed\u5904\u7406&#xff0c;\u8bed\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p> axios({<br \/>\n  \/\/ &#8230;\u8bf7\u6c42\u9009\u9879<br \/>\n}).then(result &#061;&gt; {<br \/>\n  \/\/ \u5904\u7406\u6210\u529f\u6570\u636e<br \/>\n}).catch(error &#061;&gt; {<br \/>\n  \/\/ \u5904\u7406\u5931\u8d25\u9519\u8bef<br \/>\n})<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u518d\u6b21\u91cd\u590d\u6ce8\u518c\u76f8\u540c\u7528\u6237\u540d&#xff0c;\u63d0\u793a\u7528\u6237\u6ce8\u518c\u5931\u8d25\u7684\u539f\u56e0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"238\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e79143.png\" width=\"999\" \/>\u200b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"224\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e9038d.png\" width=\"757\" \/>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5bf9\u5e94\u4ee3\u7801<\/span><\/span><\/p>\n<p> document.querySelector(&#039;.btn&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n    axios({<br \/>\n      url: &#039;http:\/\/hmajax.itheima.net\/api\/register&#039;,<br \/>\n      method: &#039;post&#039;,<br \/>\n      data: {<br \/>\n        username: &#039;itheima007&#039;,<br \/>\n        password: &#039;7654321&#039;<br \/>\n      }<br \/>\n    }).then(result &#061;&gt; {<br \/>\n      \/\/ \u6210\u529f<br \/>\n      console.log(result)<br \/>\n    }).catch(error &#061;&gt; {<br \/>\n      \/\/ \u5931\u8d25<br \/>\n      \/\/ \u5904\u7406\u9519\u8bef\u4fe1\u606f<br \/>\n      console.log(error)<br \/>\n      console.log(error.response.data.message)<br \/>\n      alert(error.response.data.message)<br \/>\n    })<br \/>\n})<\/p>\n<h4><\/h4>\n<h2 style=\"background-color:transparent\">\u4e03\u3001HTTP \u534f\u8bae-\u8bf7\u6c42\u62a5\u6587<\/h2>\n<h4><\/h4>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">HTTP \u534f\u8bae<\/span><\/span>\u89c4\u5b9a\u4e86<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u8fd4\u56de\u5185\u5bb9\u7684\u683c\u5f0f<\/span><\/span><\/p>\n<p>\u8bf7\u6c42\u62a5\u6587&#xff1a;\u662f\u6d4f<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u89c8\u5668\u6309\u7167\u534f\u8bae\u89c4\u5b9a\u53d1\u9001\u7ed9\u670d\u52a1\u5668\u7684\u5185\u5bb9<\/span><\/span><\/p>\n<p>\u4f8b\u5982\u521a\u521a\u6ce8\u518c\u7528\u6237\u65f6&#xff0c;\u53d1\u8d77\u7684\u8bf7\u6c42\u62a5\u6587&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"160\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4e9cbaf.png\" width=\"587\" \/><\/p>\n<p>\u200b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"500\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161614-683b2b4ea7c75.png\" width=\"1491\" \/>\u200b<\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8fd9\u91cc\u7684\u683c\u5f0f\u5305\u542b&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8bf7\u6c42\u884c<\/span><\/span>&#xff1a;\u8bf7\u6c42\u65b9\u6cd5&#xff0c;URL&#xff0c;\u534f\u8bae<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8bf7\u6c42\u5934<\/span><\/span>&#xff1a;\u4ee5\u952e\u503c\u5bf9\u7684\u683c\u5f0f\u643a\u5e26\u7684\u9644\u52a0\u4fe1\u606f&#xff0c;\u6bd4\u5982&#xff1a;Content-Type&#xff08;\u6307\u5b9a\u4e86\u672c\u6b21\u4f20\u9012\u7684\u5185\u5bb9\u7c7b\u578b&#xff09;<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u7a7a\u884c<\/span><\/span>&#xff1a;\u5206\u5272\u8bf7\u6c42\u5934&#xff0c;\u7a7a\u884c\u4e4b\u540e\u7684\u662f\u53d1\u9001\u7ed9\u670d\u52a1\u5668\u7684\u8d44\u6e90<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8bf7\u6c42\u4f53<\/span><\/span>&#xff1a;\u53d1\u9001\u7684\u8d44\u6e90<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u901a\u8fc7 Chrome \u7684\u7f51\u7edc\u9762\u677f\u5982\u4f55\u67e5\u770b\u8bf7\u6c42\u4f53&#xff1f;<\/span><\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"214\" src=\"2025-06-01rdihhtdls2i.png\" width=\"494\" \/><\/p>\n<p>\u200b<\/p>\n<h2><\/h2>\n<h2 style=\"background-color:transparent\">\u516b\u3001HTTP \u534f\u8bae-\u54cd\u5e94\u62a5\u6587<\/h2>\n<h4><\/h4>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u54cd\u5e94\u62a5\u6587<\/span><\/span>&#xff1a;\u662f\u670d\u52a1\u5668\u6309\u7167\u534f\u8bae\u56fa\u5b9a\u7684\u683c\u5f0f&#xff0c;<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u7684\u5185\u5bb9<\/span><\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"165\" src=\"2025-06-01zwiwhwo2kwk.png\" width=\"617\" \/><\/p>\n<p>\u200b<\/p>\n<p><span style=\"background-color:#fefcd8\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"499\" src=\"2025-06-01k4eofoobjt3.png\" width=\"807\" \/><\/span>\u200b<\/p>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u54cd\u5e94\u62a5\u6587\u7684\u7ec4\u6210&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u54cd\u5e94\u884c&#xff08;\u72b6\u6001\u884c&#xff09;<\/span><\/span>&#xff1a;\u534f\u8bae&#xff0c;HTTP\u54cd\u5e94\u72b6\u6001\u7801&#xff0c;\u72b6\u6001\u4fe1\u606f<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u54cd\u5e94\u5934<\/span><\/span>&#xff1a;\u4ee5\u952e\u503c\u5bf9\u7684\u683c\u5f0f\u643a\u5e26\u7684\u9644\u52a0\u4fe1\u606f&#xff0c;\u6bd4\u5982&#xff1a;Content-Type&#xff08;\u544a\u8bc9\u6d4f\u89c8\u5668&#xff0c;\u672c\u6b21\u8fd4\u56de\u7684\u5185\u5bb9\u7c7b\u578b&#xff09;<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u7a7a\u884c<\/span><\/span>&#xff1a;\u5206\u5272\u54cd\u5e94\u5934&#xff0c;\u63a7\u5236\u4e4b\u540e\u7684\u662f\u670d\u52a1\u5668\u8fd4\u56de\u7684\u8d44\u6e90<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u54cd\u5e94\u4f53<\/span><\/span>&#xff1a;\u8fd4\u56de\u7684\u8d44\u6e90<\/li>\n<\/ul>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">HTTP \u54cd\u5e94\u72b6\u6001\u7801&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li>\n<p>\u7528\u6765\u8868\u660e\u8bf7\u6c42\u662f\u5426\u6210\u529f\u5b8c\u6210<\/p>\n<\/li>\n<li>\n<p>\u4f8b\u5982&#xff1a;404&#xff08;\u5ba2\u6237\u7aef\u8981\u627e\u7684\u8d44\u6e90&#xff0c;\u5728\u670d\u52a1\u5668\u4e0a\u4e0d\u5b58\u5728&#xff09;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"310\" src=\"2025-06-015x2w1owx5n3.png\" width=\"348\" \/><\/p>\n<p>\u200b<\/p>\n<\/li>\n<\/ul>\n<h4><\/h4>\n<h2 style=\"background-color:transparent\">\u4e5d\u3001\u63a5\u53e3\u6587\u6863<\/h2>\n<h4><\/h4>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u63a5\u53e3\u6587\u6863<\/span><\/span>&#xff1a;\u63cf\u8ff0\u63a5\u53e3\u7684\u6587\u7ae0&#xff08;\u4e00\u822c\u662f\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u7f16\u5199\u548c\u63d0\u4f9b&#xff09;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u63a5\u53e3<\/span><\/span>&#xff1a;\u6307\u7684\u4f7f\u7528 AJAX \u548c \u670d\u52a1\u5668\u901a\u8baf\u65f6&#xff0c;\u4f7f\u7528\u7684 URL&#xff0c;\u8bf7\u6c42\u65b9\u6cd5&#xff0c;\u4ee5\u53ca\u53c2\u6570&#xff0c;\u4f8b\u5982&#xff1a;AJAX\u9636\u6bb5\u63a5\u53e3\u6587\u6863<\/p>\n<\/li>\n<li>\n<p>\u4f8b\u5982&#xff1a;\u83b7\u53d6\u57ce\u5e02\u5217\u8868\u63a5\u53e3\u6837\u5b50<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"477\" src=\"2025-06-01wjmo5vrfdl4.png\" width=\"733\" \/>\u200b<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42<\/span><\/span>&#xff1a;\u6253\u5f00 AJAX \u9636\u6bb5\u63a5\u53e3\u6587\u6863&#xff0c;\u67e5\u770b\u767b\u5f55\u63a5\u53e3&#xff0c;\u5e76\u7f16\u5199\u4ee3\u7801&#xff0c;\u5b8c\u6210\u4e00\u6b21\u767b\u5f55\u7684\u6548\u679c\u5427<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u4ee3\u7801\u5982\u4e0b<\/span><\/span>&#xff1a;<\/p>\n<p>   document.querySelector(&#039;.btn&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n  \/\/ \u7528\u6237\u767b\u5f55<br \/>\n  axios({<br \/>\n    url: &#039;http:\/\/hmajax.itheima.net\/api\/login&#039;,<br \/>\n    method: &#039;post&#039;,<br \/>\n    data: {<br \/>\n      username: &#039;itheima007&#039;,<br \/>\n      password: &#039;7654321&#039;<br \/>\n    }<br \/>\n  })<br \/>\n})<\/p>\n<\/li>\n<h4><\/h4>\n<h2>\u5341\u3001\u6848\u4f8b-\u7528\u6237\u767b\u5f55-\u4e3b\u8981\u4e1a\u52a1<\/h2>\n<h4><\/h4>\n<li>\n<p>\u8fd0\u884c\u5b8c\u6210\u7684\u9875\u9762&#xff0c;\u67e5\u770b\u8981\u5b8c\u6210\u7684<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u767b\u5f55\u6548\u679c<\/span><\/span>&#xff08;\u767b\u5f55\u6210\u529f\u548c\u5931\u8d25&#xff09;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42<\/span><\/span>&#xff1a;\u7f16\u5199\u4ee3\u7801&#xff0c;\u67e5\u770b\u63a5\u53e3\u6587\u6863&#xff0c;\u586b\u5199\u76f8\u5173\u4fe1\u606f&#xff0c;\u5b8c\u6210\u767b\u5f55\u4e1a\u52a1<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5206\u6790\u5b9e\u73b0\u7684\u6b65\u9aa4<\/span><\/span><\/p>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u70b9\u51fb\u767b\u5f55<\/span><\/span>&#xff0c;\u83b7\u53d6\u5e76\u5224\u65ad\u7528\u6237\u540d\u548c\u957f\u5ea6<\/p>\n<\/li>\n<li>\n<p>\u63d0\u4ea4<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u6570\u636e\u548c\u670d\u52a1\u5668\u901a\u4fe1<\/span><\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u63d0\u793a\u4fe1\u606f<\/span><\/span>&#xff0c;\u53cd\u9988\u7ed9\u7528\u6237<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"660\" src=\"2025-06-01x3jd0l45fwb.png\" width=\"634\" \/>\u200b<\/p>\n<\/li>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/span><\/span><\/p>\n<p>   \/\/ \u76ee\u68071&#xff1a;\u70b9\u51fb\u767b\u5f55\u65f6&#xff0c;\u7528\u6237\u540d\u548c\u5bc6\u7801\u957f\u5ea6\u5224\u65ad&#xff0c;\u5e76\u63d0\u4ea4\u6570\u636e\u548c\u670d\u52a1\u5668\u901a\u4fe1<\/p>\n<p>\/\/ 1.1 \u767b\u5f55-\u70b9\u51fb\u4e8b\u4ef6<br \/>\ndocument.querySelector(&#039;.btn-login&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n  \/\/ 1.2 \u83b7\u53d6\u7528\u6237\u540d\u548c\u5bc6\u7801<br \/>\n  const username &#061; document.querySelector(&#039;.username&#039;).value<br \/>\n  const password &#061; document.querySelector(&#039;.password&#039;).value<br \/>\n  \/\/ console.log(username, password)<\/p>\n<p>  \/\/ 1.3 \u5224\u65ad\u957f\u5ea6<br \/>\n  if (username.length &lt; 8) {<br \/>\n    console.log(&#039;\u7528\u6237\u540d\u5fc5\u987b\u5927\u4e8e\u7b49\u4e8e8\u4f4d&#039;)<br \/>\n    return \/\/ \u963b\u6b62\u4ee3\u7801\u7ee7\u7eed\u6267\u884c<br \/>\n  }<br \/>\n  if (password.length &lt; 6) {<br \/>\n    console.log(&#039;\u5bc6\u7801\u5fc5\u987b\u5927\u4e8e\u7b49\u4e8e6\u4f4d&#039;)<br \/>\n    return \/\/ \u963b\u6b62\u4ee3\u7801\u7ee7\u7eed\u6267\u884c<br \/>\n  }<\/p>\n<p>  \/\/ 1.4 \u57fa\u4e8eaxios\u63d0\u4ea4\u7528\u6237\u540d\u548c\u5bc6\u7801<br \/>\n  \/\/ console.log(&#039;\u63d0\u4ea4\u6570\u636e\u5230\u670d\u52a1\u5668&#039;)<br \/>\n  axios({<br \/>\n    url: &#039;http:\/\/hmajax.itheima.net\/api\/login&#039;,<br \/>\n    method: &#039;POST&#039;,<br \/>\n    data: {<br \/>\n      username,<br \/>\n      password<br \/>\n    }<br \/>\n  }).then(result &#061;&gt; {<br \/>\n    console.log(result)<br \/>\n    console.log(result.data.message)<br \/>\n  }).catch(error &#061;&gt; {<br \/>\n    console.log(error)<br \/>\n    console.log(error.response.data.message)<br \/>\n  })<br \/>\n})<\/p>\n<\/li>\n<h4><\/h4>\n<h2>\u5341\u4e00\u3001\u6848\u4f8b-\u7528\u6237\u767b\u5f55-\u63d0\u793a\u4fe1\u606f<\/h2>\n<h4><\/h4>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u4f7f\u7528\u63d0\u524d\u51c6\u5907\u597d\u7684\u63d0\u793a\u6846&#xff0c;\u6765\u628a\u767b\u5f55\u6210\u529f\/\u5931\u8d25\u7ed3\u679c\u63d0\u793a\u7ed9\u7528\u6237<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"660\" src=\"2025-06-01zml5foiraa5.png\" width=\"634\" \/>\u200b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"661\" src=\"2025-06-014azntluywev.png\" width=\"634\" \/>\u200b<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u4f7f\u7528\u63d0\u793a\u6846&#xff0c;\u53cd\u9988\u63d0\u793a\u6d88\u606f<\/span><\/span>&#xff0c;\u56e0\u4e3a\u67094\u5904\u5730\u65b9\u9700\u8981\u63d0\u793a\u6846&#xff0c;\u6240\u4ee5<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u5c01\u88c5\u6210\u51fd\u6570<\/span><\/span><\/p>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u83b7\u53d6\u63d0\u793a\u6846<\/span><\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5c01\u88c5\u63d0\u793a\u6846\u51fd\u6570&#xff0c;\u91cd\u590d\u8c03\u7528&#xff0c;\u6ee1\u8db3\u63d0\u793a\u9700\u6c42<\/span><\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u529f\u80fd&#xff1a;<\/span><\/span><\/p>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u663e\u793a\u63d0\u793a\u6846<\/span><\/span><\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u4e0d\u540c\u63d0\u793a\u6587\u5b57msg<\/span><\/span>&#xff0c;\u548c\u6210\u529f\u7eff\u8272\u5931\u8d25\u7ea2\u8272isSuccess\u53c2\u6570&#xff08;true\u6210\u529f&#xff0c;false\u5931\u8d25&#xff09;<\/li>\n<li>\u8fc72\u79d2\u540e&#xff0c;\u8ba9<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u63d0\u793a\u6846\u81ea\u52a8\u6d88\u5931<\/span><\/span><\/li>\n<\/li>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5bf9\u5e94\u63d0\u793a\u6846\u6838\u5fc3\u4ee3\u7801&#xff1a;<\/span><\/span><\/p>\n<p>   \/**<br \/>\n * 2.2 \u5c01\u88c5\u63d0\u793a\u6846\u51fd\u6570&#xff0c;\u91cd\u590d\u8c03\u7528&#xff0c;\u6ee1\u8db3\u63d0\u793a\u9700\u6c42<br \/>\n * \u529f\u80fd&#xff1a;<br \/>\n * 1. \u663e\u793a\u63d0\u793a\u6846<br \/>\n * 2. \u4e0d\u540c\u63d0\u793a\u6587\u5b57msg&#xff0c;\u548c\u6210\u529f\u7eff\u8272\u5931\u8d25\u7ea2\u8272isSuccess&#xff08;true\u6210\u529f&#xff0c;false\u5931\u8d25&#xff09;<br \/>\n * 3. \u8fc72\u79d2\u540e&#xff0c;\u8ba9\u63d0\u793a\u6846\u81ea\u52a8\u6d88\u5931<br \/>\n*\/<br \/>\nfunction alertFn(msg, isSuccess) {<br \/>\n  \/\/ 1&gt; \u663e\u793a\u63d0\u793a\u6846<br \/>\n  myAlert.classList.add(&#039;show&#039;)<\/p>\n<p>  \/\/ 2&gt; \u5b9e\u73b0\u7ec6\u8282<br \/>\n  myAlert.innerText &#061; msg<br \/>\n  const bgStyle &#061; isSuccess ? &#039;alert-success&#039; : &#039;alert-danger&#039;<br \/>\n  myAlert.classList.add(bgStyle)<\/p>\n<p>  \/\/ 3&gt; \u8fc72\u79d2\u9690\u85cf<br \/>\n  setTimeout(() &#061;&gt; {<br \/>\n    myAlert.classList.remove(&#039;show&#039;)<br \/>\n    \/\/ \u63d0\u793a&#xff1a;\u907f\u514d\u7c7b\u540d\u51b2\u7a81&#xff0c;\u91cd\u7f6e\u80cc\u666f\u8272<br \/>\n    myAlert.classList.remove(bgStyle)<br \/>\n  }, 2000)<br \/>\n}<\/p>\n<\/li>\n<h4><\/h4>\n<h2>\u5341\u4e8c\u3001form-serialize \u63d2\u4ef6<\/h2>\n<h4><\/h4>\n<li>\n<p>\u6211\u4eec\u524d\u9762\u6536\u96c6\u8868\u5355\u5143\u7d20\u7684\u503c&#xff0c;\u662f\u4e00\u4e2a\u4e2a\u6807\u7b7e\u83b7\u53d6\u7684<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"347\" src=\"2025-06-01spexgcfodcl.png\" width=\"813\" \/>\u200b<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u4e00\u5957\u8868\u5355\u91cc\u6709\u5f88\u591a\u5f88\u591a\u8868\u5355\u5143\u7d20&#xff0c;\u5982\u4f55\u4e00\u6b21\u6027\u5feb\u901f\u6536\u96c6\u51fa\u6765\u5462&#xff1f;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"843\" src=\"2025-06-01f1ksh1wslqg.png\" width=\"1046\" \/>\u200b<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> form-serialize <\/span><\/span>\u63d2\u4ef6\u63d0\u4f9b\u7684<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> serialize <\/span><\/span>\u51fd\u6570\u5c31\u53ef\u4ee5\u529e\u5230<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">form-serialize <\/span><\/span>\u63d2\u4ef6\u8bed\u6cd5&#xff1a;<\/p>\n<li>\n<p>\u5f15\u5165<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> form-serialize <\/span><\/span>\u63d2\u4ef6\u5230\u81ea\u5df1\u7f51\u9875\u4e2d<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> serialize <\/span><\/span>\u51fd\u6570<\/p>\n<ul>\n<li>\n<p>\u53c2\u65701&#xff1a;\u8981\u83b7\u53d6\u7684<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> form <\/span><\/span>\u8868\u5355\u6807\u7b7e\u5bf9\u8c61&#xff08;\u8981\u6c42\u8868\u5355\u5143\u7d20\u9700\u8981\u6709<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> name \u5c5e\u6027<\/span><\/span>-\u7528\u6765\u4f5c\u4e3a\u6536\u96c6\u7684\u6570\u636e\u4e2d\u5c5e\u6027\u540d&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u53c2\u65702&#xff1a;\u914d\u7f6e\u5bf9\u8c61<\/p>\n<ul>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">hash&#xff1a;<\/span><\/span>\n<ul>\n<li>true &#8211; \u6536\u96c6\u51fa\u6765\u7684\u662f\u4e00\u4e2a JS \u5bf9\u8c61\u7ed3\u6784<\/li>\n<li>false &#8211; \u6536\u96c6\u51fa\u6765\u7684\u662f\u4e00\u4e2a\u67e5\u8be2\u5b57\u7b26\u4e32\u683c\u5f0f<\/li>\n<\/ul>\n<\/li>\n<li><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">empty&#xff1a;<\/span><\/span>\n<ul>\n<li>true &#8211; \u6536\u96c6\u7a7a\u503c<\/li>\n<li>false &#8211; \u4e0d\u6536\u96c6\u7a7a\u503c<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\">\u9700\u6c42&#xff1a;<\/span><\/span>\u6536\u96c6\u767b\u5f55\u8868\u5355\u91cc\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5bf9\u5e94\u4ee3\u7801&#xff1a;<\/span><\/span><\/p>\n<p>   &lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<\/p>\n<p>&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;meta http-equiv&#061;&#034;X-UA-Compatible&#034; content&#061;&#034;IE&#061;edge&#034;&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n  &lt;title&gt;form-serialize\u63d2\u4ef6\u4f7f\u7528&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n  &lt;form action&#061;&#034;javascript:;&#034; class&#061;&#034;example-form&#034;&gt;<br \/>\n    &lt;input type&#061;&#034;text&#034; name&#061;&#034;username&#034;&gt;<br \/>\n    &lt;br&gt;<br \/>\n    &lt;input type&#061;&#034;text&#034; name&#061;&#034;password&#034;&gt;<br \/>\n    &lt;br&gt;<br \/>\n    &lt;input type&#061;&#034;button&#034; class&#061;&#034;btn&#034; value&#061;&#034;\u63d0\u4ea4&#034;&gt;<br \/>\n  &lt;\/form&gt;<br \/>\n  &lt;!&#8211;<br \/>\n    \u76ee\u6807&#xff1a;\u5728\u70b9\u51fb\u63d0\u4ea4\u65f6&#xff0c;\u4f7f\u7528form-serialize\u63d2\u4ef6&#xff0c;\u5feb\u901f\u6536\u96c6\u8868\u5355\u5143\u7d20\u503c<br \/>\n    1. \u628a\u63d2\u4ef6\u5f15\u5165\u5230\u81ea\u5df1\u7f51\u9875\u4e2d<br \/>\n  &#8211;&gt;<br \/>\n  &lt;script src&#061;&#034;.\/lib\/form-serialize.js&#034;&gt;&lt;\/script&gt;<br \/>\n  &lt;script&gt;<br \/>\n    document.querySelector(&#039;.btn&#039;).addEventListener(&#039;click&#039;, () &#061;&gt; {<br \/>\n      \/**<br \/>\n       * 2. \u4f7f\u7528serialize\u51fd\u6570&#xff0c;\u5feb\u901f\u6536\u96c6\u8868\u5355\u5143\u7d20\u7684\u503c<br \/>\n       * \u53c2\u65701&#xff1a;\u8981\u83b7\u53d6\u54ea\u4e2a\u8868\u5355\u7684\u6570\u636e<br \/>\n       *  \u8868\u5355\u5143\u7d20\u8bbe\u7f6ename\u5c5e\u6027&#xff0c;\u503c\u4f1a\u4f5c\u4e3a\u5bf9\u8c61\u7684\u5c5e\u6027\u540d<br \/>\n       *  \u5efa\u8baename\u5c5e\u6027\u7684\u503c&#xff0c;\u6700\u597d\u548c\u63a5\u53e3\u6587\u6863\u53c2\u6570\u540d\u4e00\u81f4<br \/>\n       * \u53c2\u65702&#xff1a;\u914d\u7f6e\u5bf9\u8c61<br \/>\n       *  hash \u8bbe\u7f6e\u83b7\u53d6\u6570\u636e\u7ed3\u6784<br \/>\n       *    &#8211; true&#xff1a;JS\u5bf9\u8c61&#xff08;\u63a8\u8350&#xff09;\u4e00\u822c\u8bf7\u6c42\u4f53\u91cc\u63d0\u4ea4\u7ed9\u670d\u52a1\u5668<br \/>\n       *    &#8211; false: \u67e5\u8be2\u5b57\u7b26\u4e32<br \/>\n       *  empty \u8bbe\u7f6e\u662f\u5426\u83b7\u53d6\u7a7a\u503c<br \/>\n       *    &#8211; true: \u83b7\u53d6\u7a7a\u503c&#xff08;\u63a8\u8350&#xff09;\u6570\u636e\u7ed3\u6784\u548c\u6807\u7b7e\u7ed3\u6784\u4e00\u81f4<br \/>\n       *    &#8211; false&#xff1a;\u4e0d\u83b7\u53d6\u7a7a\u503c<br \/>\n      *\/<br \/>\n      const form &#061; document.querySelector(&#039;.example-form&#039;)<br \/>\n      const data &#061; serialize(form, { hash: true, empty: true })<br \/>\n      \/\/ const data &#061; serialize(form, { hash: false, empty: true })<br \/>\n      \/\/ const data &#061; serialize(form, { hash: true, empty: false })<br \/>\n      console.log(data)<br \/>\n    })<br \/>\n  &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<\/li>\n<h4><\/h4>\n<h2>\u5341\u4e09\u3001\u6848\u4f8b-\u7528\u6237\u767b\u5f55-form-serialize<\/h2>\n<h4><\/h4>\n<li>\n<p>\u57fa\u4e8e\u6a21\u677f\u4ee3\u7801&#xff0c;\u4f7f\u7528<span style=\"color:#fe2c24\"><span style=\"background-color:#fefcd8\"> form-serialize <\/span><\/span>\u63d2\u4ef6\u6765\u6536\u96c6\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<\/li>\n<li>\n<p>\u5728\u539f\u6765\u7684\u4ee3\u7801\u57fa\u7840\u4e0a\u4fee\u6539\u5373\u53ef<\/p>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u5148\u5f15\u5165\u63d2\u4ef6<\/span><\/span><\/p>\n<p>     &lt;!&#8211; 3.1 \u5f15\u5165\u63d2\u4ef6 &#8211;&gt;<br \/>\n&lt;script src&#061;&#034;.\/lib\/form-serialize.js&#034;&gt;&lt;\/script&gt;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#fefcd8\">\u7136\u540e\u4fee\u6539\u4ee3\u7801<\/span><\/span><\/p>\n<p>     \/\/ 3.2 \u4f7f\u7528serialize\u51fd\u6570&#xff0c;\u6536\u96c6\u767b\u5f55\u8868\u5355\u91cc\u7528\u6237\u540d\u548c\u5bc6\u7801<br \/>\nconst form &#061; document.querySelector(&#039;.login-form&#039;)<br \/>\nconst data &#061; serialize(form, { hash: true, empty: true })<br \/>\nconsole.log(data)<br \/>\n\/\/ {username: &#039;itheima007&#039;, password: &#039;7654321&#039;}<br \/>\nconst { username, password } &#061; data<\/p>\n<\/li>\n<\/li>\n<h4><\/h4>\n<h3>\u53c2\u8003\u6587\u732e<\/h3>\n<li>\u5ba2\u6237\u7aef-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u6d4f\u89c8\u5668\u89e3\u91ca-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u670d\u52a1\u5668\u89e3\u91ca-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>url\u89e3\u91ca-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>http\u534f\u8bae-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u4e3b\u673a\u540d-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u7aef\u53e3\u53f7-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>Ajax\u89e3\u91ca-&gt;\u767e\u5ea6-\u61c2\u5566<\/li>\n<li>Ajax\u89e3\u91ca-&gt;MDN\u89e3\u91caAjax\u662f\u4e0e\u670d\u52a1\u5668\u901a\u4fe1\u800c\u4e0d\u53ea\u662f\u8bf7\u6c42<\/li>\n<li>axios-&gt;\u767e\u5ea6(\u53ef\u4ee5\u70b9\u51fb\u64ad\u62a5\u542c\u8bfb\u97f3)<\/li>\n<li>axios(github)\u5730\u5740<\/li>\n<li>axios\u5b98\u65b9\u63a8\u8350\u5b98\u7f51<\/li>\n<li>axios(npmjs)\u5730\u5740<\/li>\n<li>GET\u548cPOST\u533a\u522b-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u62a5\u6587\u8bb2\u89e3-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>HTTP\u72b6\u6001\u7801-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<li>\u63a5\u53e3\u6982\u5ff5-&gt;\u767e\u5ea6\u767e\u79d1<\/li>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-01zffxt0cwhf4.gif\" \/>\u00a0<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"2025-06-01oqiwa5xwhda.gif\" \/><img decoding=\"async\" alt=\"\" class=\"right\" src=\"2025-06-01oqiwa5xwhda.gif\" \/>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb823\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u6b66\u4fa0\u7b14\u6cd5\u89e3\u6784AJAX\u6c5f\u6e56\uff1a\u4ece\u300caxios\u65e0\u5f71\u624b\u300d\u521d\u63a2\u6570\u636e\u63a5\u62db\uff0c\u5230\u300cURL\u98ce\u6c34\u9635\u300d\u7834\u8bd1\u8d44\u6e90\u547d\u8109\uff1b\u4ee5POST\u5251\u5f0f\u95ef\u6570\u636e\u7384\u5173\uff0c\u501fHTTP\u70fd\u70df\u8bc6\u54cd\u5e94\u5929\u673a\u3002\u65e0\u5e38\u7c3f\u5f55\u5c3d\u8bf7\u6c42\u56e0\u679c\uff0c\u751f\u6b7b\u7b26\u9501\u4f4f\u5f02\u6b65\u6069\u4ec7\u3002\u8de8\u57df\u8f7b\u529f\u51cc\u8d8a\u540c\u6e90\u94c1\u58c1\uff0cForm\u5bc6\u4ee4\u5316\u5f62\u86df\u9f99\u4f20\u4e66\u3002\u6b64\u756a\u6c5f\u6e56\u8def\uff0c\u65e2\u662f\u6570\u636e\u7ecf\u8109\u7684\u6d17\u9ad3\u91cd\u5851\uff0c\u4ea6\u662f\u63a5\u53e3\u5951\u7ea6\u7684\u4fa0\u4e49\u4ea4\u950b\u2014\u2014\u4ee3\u7801\u5982\u5203\uff0c\u534f\u8bae\u4e3a\u9798\uff0c\u4e14\u770b\u5f00\u53d1\u8005\u5982\u4f55\u4ee5Ajax\u4e3a\u821f\uff0c\u6a2a\u6e21\u524d\u540e\u7aef\u6c5f\u6e56\u7684\u6ce2\u6d9b\u3002<\/p>\n","protected":false},"author":2,"featured_media":41189,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3236,187,87],"topic":[],"class_list":["post-41209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ajax","tag-javascript","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/41209.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb823\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u6b66\u4fa0\u7b14\u6cd5\u89e3\u6784AJAX\u6c5f\u6e56\uff1a\u4ece\u300caxios\u65e0\u5f71\u624b\u300d\u521d\u63a2\u6570\u636e\u63a5\u62db\uff0c\u5230\u300cURL\u98ce\u6c34\u9635\u300d\u7834\u8bd1\u8d44\u6e90\u547d\u8109\uff1b\u4ee5POST\u5251\u5f0f\u95ef\u6570\u636e\u7384\u5173\uff0c\u501fHTTP\u70fd\u70df\u8bc6\u54cd\u5e94\u5929\u673a\u3002\u65e0\u5e38\u7c3f\u5f55\u5c3d\u8bf7\u6c42\u56e0\u679c\uff0c\u751f\u6b7b\u7b26\u9501\u4f4f\u5f02\u6b65\u6069\u4ec7\u3002\u8de8\u57df\u8f7b\u529f\u51cc\u8d8a\u540c\u6e90\u94c1\u58c1\uff0cForm\u5bc6\u4ee4\u5316\u5f62\u86df\u9f99\u4f20\u4e66\u3002\u6b64\u756a\u6c5f\u6e56\u8def\uff0c\u65e2\u662f\u6570\u636e\u7ecf\u8109\u7684\u6d17\u9ad3\u91cd\u5851\uff0c\u4ea6\u662f\u63a5\u53e3\u5951\u7ea6\u7684\u4fa0\u4e49\u4ea4\u950b\u2014\u2014\u4ee3\u7801\u5982\u5203\uff0c\u534f\u8bae\u4e3a\u9798\uff0c\u4e14\u770b\u5f00\u53d1\u8005\u5982\u4f55\u4ee5Ajax\u4e3a\u821f\uff0c\u6a2a\u6e21\u524d\u540e\u7aef\u6c5f\u6e56\u7684\u6ce2\u6d9b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/41209.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-31T16:16:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4c93c5a.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41209.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/41209.html\",\"name\":\"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-31T16:16:15+00:00\",\"dateModified\":\"2025-05-31T16:16:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/41209.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/41209.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41209.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/41209.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb823\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u6b66\u4fa0\u7b14\u6cd5\u89e3\u6784AJAX\u6c5f\u6e56\uff1a\u4ece\u300caxios\u65e0\u5f71\u624b\u300d\u521d\u63a2\u6570\u636e\u63a5\u62db\uff0c\u5230\u300cURL\u98ce\u6c34\u9635\u300d\u7834\u8bd1\u8d44\u6e90\u547d\u8109\uff1b\u4ee5POST\u5251\u5f0f\u95ef\u6570\u636e\u7384\u5173\uff0c\u501fHTTP\u70fd\u70df\u8bc6\u54cd\u5e94\u5929\u673a\u3002\u65e0\u5e38\u7c3f\u5f55\u5c3d\u8bf7\u6c42\u56e0\u679c\uff0c\u751f\u6b7b\u7b26\u9501\u4f4f\u5f02\u6b65\u6069\u4ec7\u3002\u8de8\u57df\u8f7b\u529f\u51cc\u8d8a\u540c\u6e90\u94c1\u58c1\uff0cForm\u5bc6\u4ee4\u5316\u5f62\u86df\u9f99\u4f20\u4e66\u3002\u6b64\u756a\u6c5f\u6e56\u8def\uff0c\u65e2\u662f\u6570\u636e\u7ecf\u8109\u7684\u6d17\u9ad3\u91cd\u5851\uff0c\u4ea6\u662f\u63a5\u53e3\u5951\u7ea6\u7684\u4fa0\u4e49\u4ea4\u950b\u2014\u2014\u4ee3\u7801\u5982\u5203\uff0c\u534f\u8bae\u4e3a\u9798\uff0c\u4e14\u770b\u5f00\u53d1\u8005\u5982\u4f55\u4ee5Ajax\u4e3a\u821f\uff0c\u6a2a\u6e21\u524d\u540e\u7aef\u6c5f\u6e56\u7684\u6ce2\u6d9b\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/41209.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-31T16:16:15+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250531161612-683b2b4c93c5a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/41209.html","url":"https:\/\/www.wsisp.com\/helps\/41209.html","name":"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-31T16:16:15+00:00","dateModified":"2025-05-31T16:16:15+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/41209.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/41209.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/41209.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010JavaScript\u3011Ajax \u4fa0\u5ba2\u884c\uff1aaxios \u8f7b\u529f\u7a7f\u68ad\u670d\u52a1\u5668\u95f4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=41209"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41209\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/41189"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=41209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=41209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=41209"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=41209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}