{"id":484,"date":"2025-12-05T10:38:50","date_gmt":"2025-12-05T02:38:50","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=484"},"modified":"2025-12-05T10:38:50","modified_gmt":"2025-12-05T02:38:50","slug":"js%e6%8e%a7%e5%88%b6%e6%b5%8f%e8%a7%88%e5%99%a8%e5%89%8d%e8%bf%9b%e3%80%81%e5%90%8e%e9%80%80%e3%80%81%e9%a1%b5%e9%9d%a2%e8%b7%b3%e8%bd%ac%e8%af%a6%e7%bb%86%e6%96%b9%e6%b3%95%e5%92%8c%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/12\/05\/js%e6%8e%a7%e5%88%b6%e6%b5%8f%e8%a7%88%e5%99%a8%e5%89%8d%e8%bf%9b%e3%80%81%e5%90%8e%e9%80%80%e3%80%81%e9%a1%b5%e9%9d%a2%e8%b7%b3%e8%bd%ac%e8%af%a6%e7%bb%86%e6%96%b9%e6%b3%95%e5%92%8c%e7%a4%ba%e4%be%8b\/","title":{"rendered":"js\u63a7\u5236\u6d4f\u89c8\u5668\u524d\u8fdb\u3001\u540e\u9000\u3001\u9875\u9762\u8df3\u8f6c\u8be6\u7ec6\u65b9\u6cd5\u548c\u793a\u4f8b"},"content":{"rendered":"\n<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u4efd <strong>\u300aJS \u63a7\u5236\u6d4f\u89c8\u5668\u524d\u8fdb\u3001\u540e\u9000\u3001\u9875\u9762\u8df3\u8f6c\u2014\u2014\u6700\u5168\u8be6\u7ec6\u65b9\u6cd5\u4e0e\u793a\u4f8b\u300b<\/strong>\uff0c\u5305\u542b\u6700\u65b0\u6d4f\u89c8\u5668\u89c4\u8303\uff08\u542b History API\u3001Location API\u3001hash \u8df3\u8f6c\u3001SPA \u573a\u666f\u7b49\uff09\u3002\u8fd9\u662f\u4f60\u80fd\u770b\u5230\u6700\u5b8c\u6574\u7684\u4e00\u7248\uff0c\u9002\u5408\u65b0\u624b\u5230\u9ad8\u7ea7\u5f00\u53d1\u8005\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u4e00\u3001\u6d4f\u89c8\u5668\u8df3\u8f6c\u3001\u524d\u8fdb\u3001\u540e\u9000\u7684\u4e09\u5927 API \u5206\u522b\u662f\u4ec0\u4e48\uff1f<\/h1>\n\n\n\n<p>JS \u63a7\u5236\u6d4f\u89c8\u5668\u5bfc\u822a\u7684\u4e3b\u8981 API\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>API<\/th><th>\u7528\u9014<\/th><\/tr><\/thead><tbody><tr><td><strong>location<\/strong><\/td><td>\u9875\u9762\u8df3\u8f6c\u3001\u5237\u65b0<\/td><\/tr><tr><td><strong>history<\/strong><\/td><td>\u524d\u8fdb\u3001\u540e\u9000\u3001\u4fee\u6539\u5386\u53f2\u8bb0\u5f55<\/td><\/tr><tr><td><strong>window<\/strong><\/td><td>\u63a7\u5236\u7a97\u53e3\u3001\u6253\u5f00\u65b0\u9875\u9762<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u4e8c\u3001Location API \u2014\u2014 \u9875\u9762\u8df3\u8f6c\u6700\u5e38\u7528<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u5f3a\u5236\u8df3\u8f6c\uff08\u4f1a\u4ea7\u751f\u5386\u53f2\u8bb0\u5f55\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.href = &quot;https:\/\/example.com&quot;;\n\n<\/pre><\/div>\n\n\n<p>\u7b49\u4ef7\u4e8e\u70b9\u51fb\u94fe\u63a5\uff0c\u4f1a\u52a0\u5165\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\uff0c\u80fd <strong>\u8fd4\u56de<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u4f7f\u7528 <code>location.assign()<\/code>\uff08\u5b8c\u5168\u7b49\u4e8e href\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.assign(&quot;https:\/\/example.com&quot;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u9875\u9762\u91cd\u5b9a\u5411\uff08\u4e0d\u4ea7\u751f\u5386\u53f2\u8bb0\u5f55\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.replace(&quot;https:\/\/example.com&quot;);\n\n<\/pre><\/div>\n\n\n<p>\u7528\u6237 <strong>\u65e0\u6cd5\u8fd4\u56de\u4e0a\u4e00\u9875<\/strong>\uff08\u7528\u4e8e\u767b\u5f55\u91cd\u5b9a\u5411\u3001\u9274\u6743\u8df3\u8f6c\uff09\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 \u5237\u65b0\u9875\u9762<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.reload();      \/\/ \u666e\u901a\u5237\u65b0\uff08\u6709\u7f13\u5b58\uff09\nlocation.reload(true);  \/\/ \u5f3a\u5236\u5237\u65b0\uff08\u5df2\u5e9f\u5f03\uff0c\u4e0d\u5efa\u8bae\uff09\n\n<\/pre><\/div>\n\n\n<p>\u73b0\u4ee3\u5199\u6cd5\u5f3a\u5236\u5237\u65b0\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.href = location.href;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">5\ufe0f\u20e3 \u83b7\u53d6\u5f53\u524d\u9875\u9762 URL \u4fe1\u606f<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconsole.log(location.href);\nconsole.log(location.pathname);\nconsole.log(location.hash);\nconsole.log(location.search);\nconsole.log(location.origin);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u4e09\u3001History API \u2014\u2014 \u63a7\u5236\u524d\u8fdb\/\u540e\u9000\u3001\u4fee\u6539\u5386\u53f2<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u540e\u9000\u4e00\u9875<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.back();\n\n<\/pre><\/div>\n\n\n<p>\u7b49\u4ef7\u4e8e\u7528\u6237\u70b9\u51fb \u201c\u8fd4\u56de\u201d\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u524d\u8fdb\u4e00\u6b65<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.forward();\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u524d\u8fdb\/\u540e\u9000 N \u6b65<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.go(-1); \/\/ \u540e\u9000\u4e00\u9875\nhistory.go(1);  \/\/ \u524d\u8fdb\u4e00\u9875\nhistory.go(2);  \/\/ \u524d\u8fdb 2 \u9875\nhistory.go(-3); \/\/ \u540e\u9000 3 \u9875\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 pushState\uff08\u65b0\u589e\u5386\u53f2\u8bb0\u5f55\u4f46\u4e0d\u8df3\u8f6c\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.pushState({id:1}, &quot;&quot;, &quot;\/product?id=1&quot;);\n\n<\/pre><\/div>\n\n\n<p>\u4f5c\u7528\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9875\u9762\u4e0d\u5237\u65b0<\/strong><\/li>\n\n\n\n<li>URL \u53d1\u751f\u6539\u53d8<\/li>\n\n\n\n<li>\u4f1a\u52a0\u5165\u5386\u53f2\u6808\uff08\u53ef\u8fd4\u56de\uff09<\/li>\n<\/ul>\n\n\n\n<p>SPA \u8def\u7531\u4f7f\u7528\u8be5\u65b9\u6cd5\uff08Vue Router \/ React Router\uff09\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">5\ufe0f\u20e3 replaceState\uff08\u4fee\u6539\u5f53\u524d\u8bb0\u5f55\u4e0d\u65b0\u589e\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.replaceState({step:2}, &quot;&quot;, &quot;\/checkout\/step2&quot;);\n\n<\/pre><\/div>\n\n\n<p>\u9002\u5408\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5355\u9875\u5e94\u7528\u66ff\u6362\u5f53\u524d URL<\/li>\n\n\n\n<li>\u767b\u5f55\u6210\u529f\u540e\u91cd\u5199\u5730\u5740\uff0c\u907f\u514d\u7528\u6237\u8fd4\u56de\u767b\u5f55\u9875<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">6\ufe0f\u20e3 \u6355\u83b7\u6d4f\u89c8\u5668\u524d\u8fdb\/\u540e\u9000\u4e8b\u4ef6<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwindow.onpopstate = function (event) {\n    console.log(&quot;\u7528\u6237\u70b9\u51fb\u4e86\u8fd4\u56de\u6216\u524d\u8fdb&quot;, event.state);\n};\n\n<\/pre><\/div>\n\n\n<p>SPA \u76d1\u542c\u8def\u7531\u53d8\u5316\u5fc5\u987b\u7528\u5230\u5b83\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u56db\u3001Hash\uff08#\uff09\u8df3\u8f6c\uff08\u65e0\u9700\u5237\u65b0\u9875\u9762\uff09<\/h1>\n\n\n\n<p>\u6539\u53d8 hash\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.hash = &quot;#section2&quot;;\n\n<\/pre><\/div>\n\n\n<p>\u6216\u8005\u5e26\u5185\u5bb9\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.hash = &quot;id=123&quot;;\n\n<\/pre><\/div>\n\n\n<p>\u4f18\u52bf\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u5237\u65b0\u9875\u9762<\/li>\n\n\n\n<li>\u517c\u5bb9\u6027\u6781\u597d<\/li>\n\n\n\n<li>\u53ef\u76d1\u542c<\/li>\n<\/ul>\n\n\n\n<p>\u76d1\u542c hash \u53d8\u5316\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwindow.addEventListener(&quot;hashchange&quot;, () =&gt; {\n    console.log(&quot;hash changed:&quot;, location.hash);\n});\n\n<\/pre><\/div>\n\n\n<p>Vue Router \u7684 hash \u6a21\u5f0f\u5c31\u662f\u57fa\u4e8e\u6b64\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u4e94\u3001JS \u6253\u5f00\u65b0\u7a97\u53e3\u3001\u5173\u95ed\u7a97\u53e3<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u6253\u5f00\u65b0\u7a97\u53e3\uff08\u540e\u9762\u53ef\u63a7\u5236\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst win = window.open(&quot;https:\/\/example.com&quot;, &quot;_blank&quot;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u6253\u5f00\u7a7a\u767d\u7a97\u53e3\uff08\u4e0d\u88ab\u963b\u6b62\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst win = window.open(&quot;&quot;, &quot;_blank&quot;);\nwin.location.href = &quot;https:\/\/example.com&quot;;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u5173\u95ed\u5f53\u524d\u7a97\u53e3<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwindow.close();\n\n<\/pre><\/div>\n\n\n<p>\u26a0\ufe0f \u53ea\u6709\u811a\u672c\u6253\u5f00\u7684\u7a97\u53e3\u624d\u5141\u8bb8\u5173\u95ed\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u516d\u3001\u603b\u7ed3\u5bf9\u6bd4\uff08\u6700\u5e38\u7528\u65b9\u6cd5\u8868\uff09<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u529f\u80fd<\/th><th>\u65b9\u6cd5<\/th><th>\u662f\u5426\u5237\u65b0<\/th><th>\u662f\u5426\u53ef\u8fd4\u56de<\/th><\/tr><\/thead><tbody><tr><td>\u8df3\u8f6c<\/td><td>location.href<\/td><td>\u2714<\/td><td>\u2714<\/td><\/tr><tr><td>\u8df3\u8f6c<\/td><td>location.assign<\/td><td>\u2714<\/td><td>\u2714<\/td><\/tr><tr><td>\u8df3\u8f6c\uff08\u4e0d\u53ef\u8fd4\u56de\uff09<\/td><td>location.replace<\/td><td>\u2714<\/td><td>\u2716<\/td><\/tr><tr><td>\u5237\u65b0<\/td><td>location.reload<\/td><td>\u2714<\/td><td>\u2014<\/td><\/tr><tr><td>\u540e\u9000<\/td><td>history.back<\/td><td>\u2716<\/td><td>\u2014<\/td><\/tr><tr><td>\u524d\u8fdb<\/td><td>history.forward<\/td><td>\u2716<\/td><td>\u2014<\/td><\/tr><tr><td>\u524d\u8fdb\u540e\u9000<\/td><td>history.go<\/td><td>\u2716<\/td><td>\u2014<\/td><\/tr><tr><td>\u65b0\u589e\u5386\u53f2\u8bb0\u5f55<\/td><td>history.pushState<\/td><td>\u2716<\/td><td>\u2714<\/td><\/tr><tr><td>\u66ff\u6362\u5386\u53f2\u8bb0\u5f55<\/td><td>history.replaceState<\/td><td>\u2716<\/td><td>\u2716<\/td><\/tr><tr><td>\u6253\u5f00\u65b0\u7a97\u53e3<\/td><td>window.open<\/td><td>\u2714<\/td><td>\u2714<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u4e03\u3001\u5178\u578b\u5b9e\u6218\u793a\u4f8b<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u2714 \u793a\u4f8b 1\uff1a\u7528\u6237\u767b\u5f55\u540e\u8df3\u8f6c\uff0c\u4e0d\u5141\u8bb8\u8fd4\u56de\u767b\u5f55\u9875<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlocation.replace(&quot;\/home&quot;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2714 \u793a\u4f8b 2\uff1a\u5546\u54c1\u9875\u5207\u6362\u8def\u7531\u800c\u4e0d\u5237\u65b0\uff08SPA\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.pushState({product:101}, &quot;&quot;, &quot;\/product\/101&quot;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2714 \u793a\u4f8b 3\uff1a\u76d1\u542c\u7528\u6237\u70b9\u51fb\u6d4f\u89c8\u5668\u8fd4\u56de\u952e<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwindow.onpopstate = (event) =&gt; {\n    console.log(&quot;\u7528\u6237\u8fd4\u56de\u4e86&quot;, event.state);\n};\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2714 \u793a\u4f8b 4\uff1a\u591a\u6b65\u8868\u5355\u963b\u6b62\u7528\u6237\u8fd4\u56de<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhistory.pushState(null, &quot;&quot;, location.href);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2714 \u793a\u4f8b 5\uff1a\u6253\u5f00\u4e00\u4e2a\u652f\u4ed8\u9875\u9762<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwindow.open(&quot;https:\/\/pay.xxx.com&quot;, &quot;_blank&quot;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\ude80 \u516b\u3001\u524d\u7aef\u9879\u76ee\uff08Vue\/React\uff09\u5982\u4f55\u6b63\u786e\u4f7f\u7528\uff1f<\/h1>\n\n\n\n<p>\u2714 Vue Router\uff1a\u5185\u90e8\u4f7f\u7528 <code>pushState<\/code>\/<code>replaceState<\/code><br>\u2714 React Router\uff1a\u540c\u6837\u7528 History API<br>\u2714 \u6d4f\u89c8\u5668\u8fd4\u56de\u952e \u2192 <code>popstate<\/code> \u4e8b\u4ef6<br>\u2714 404\/\u5237\u65b0\u9700\u8981\u540e\u7aef\u652f\u6301 history fallback<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u4efd \u300aJS \u63a7\u5236\u6d4f\u89c8\u5668\u524d\u8fdb\u3001\u540e\u9000\u3001\u9875\u9762\u8df3\u8f6c\u2014\u2014\u6700\u5168\u8be6\u7ec6\u65b9\u6cd5\u4e0e\u793a\u4f8b\u300b\uff0c\u5305&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/12\/05\/js%e6%8e%a7%e5%88%b6%e6%b5%8f%e8%a7%88%e5%99%a8%e5%89%8d%e8%bf%9b%e3%80%81%e5%90%8e%e9%80%80%e3%80%81%e9%a1%b5%e9%9d%a2%e8%b7%b3%e8%bd%ac%e8%af%a6%e7%bb%86%e6%96%b9%e6%b3%95%e5%92%8c%e7%a4%ba%e4%be%8b\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-javascript"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":485,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/484\/revisions\/485"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}