{"id":52719,"date":"2024-12-03T10:00:35","date_gmt":"2024-12-03T02:00:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52719\/"},"modified":"2024-12-03T10:00:35","modified_gmt":"2024-12-03T02:00:35","slug":"javascript%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e6%b5%8f%e8%a7%88%e5%99%a8%e5%8e%86%e5%8f%b2%e8%ae%b0%e5%bd%95%e4%b8%ad%e7%9a%84%e5%bd%93%e5%89%8d%e4%bd%8d%e7%bd%ae%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52719\/","title":{"rendered":"JavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>JavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f<\/h1>\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300aJavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241122\/173228297367408a5d8d835.jpg\" class=\"aligncenter\" title=\"JavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f\u63d2\u56fe\" alt=\"JavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e86\u89e3\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5047\u8bbe\u4f60\u6b63\u5904\u4e8e\u5982\u4e0b\u6d4f\u89c8\u5386\u53f2\u8bb0\u5f55\u4e2d\uff1a<\/p>\n<pre>A. \u9996\u9875\nB. \u9875\u9762\nC. \u5f53\u524d\u9875\u9762<\/pre>\n<p>\u5f53\u4f60\u89e6\u53d1 history.back \u65f6\uff0c\u4f60\u5c06\u56de\u5230\u9875\u9762 b\u3002\u95ee\u9898\u662f\uff1a\u5982\u4f55\u4ece javascript \u4e2d\u5f97\u77e5\u4f60\u5f53\u524d\u5728\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u4f4d\u7f6e\uff08\u5373 2\uff09\uff1f<\/p>\n<p><strong>\u4f7f\u7528 javascript \u68c0\u6d4b\u5f53\u524d\u4f4d\u7f6e<\/strong><\/p>\n<p>\u4ee5\u4e0b\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f46\u5b58\u5728\u517c\u5bb9\u6027\u95ee\u9898\uff1a<\/p>\n<p><strong>\u76d1\u542c popstate \u4e8b\u4ef6<\/strong><\/p>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u624b\u52a8\u7ef4\u62a4\u4e00\u4e2a\u5386\u53f2\u6808\uff0c\u4ec5\u9002\u7528\u4e8e\u5355\u9875\u5e94\u7528\u3002<\/p>\n<p><strong>\u4f7f\u7528 navigation api<\/strong><\/p>\n<p>navigation api \u63d0\u4f9b\u4e86 navigation.entries() \u65b9\u6cd5\uff0c\u5b83\u8fd4\u56de\u4e00\u4e2a\u5386\u53f2\u8bb0\u5f55\u9879\u6570\u7ec4\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u65b9\u6cd5\u7684\u517c\u5bb9\u6027\u4e5f\u8f83\u5dee\u3002<\/p>\n<p><strong>\u517c\u5bb9\u6027<\/strong><\/p>\n<p>\u4f7f\u7528 popstate \u4e8b\u4ef6\u6216 navigation api \u7684\u517c\u5bb9\u6027\u5982\u4e0b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6d4f\u89c8\u5668<\/th>\n<th>popstate<\/th>\n<th>navigation api<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>chrome<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>firefox<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>safari<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u4e0d\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>edge<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u4e0d\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>ie<\/td>\n<td>\u4e0d\u652f\u6301<\/td>\n<td>\u4e0d\u652f\u6301<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6587\u7ae0\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Vue3 \u9879\u76ee\u4e2d\uff0c\u5982\u4f55\u8c03\u8bd5\u6ca1\u6709\u63d0\u4f9b\u8c03\u7528\u6307\u5357\u7684 npm \u5305\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f \u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300aJavaScript\u5982\u4f55\u83b7\u53d6\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~ \u4e86\u89e3\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u5f53\u524d\u4f4d\u7f6e \u5047\u8bbe\u4f60\u6b63\u5904\u4e8e\u5982\u4e0b\u6d4f\u89c8\u5386\u53f2\u8bb0\u5f55\u4e2d\uff1a A. \u9996\u9875 B. \u9875\u9762 C. \u5f53\u524d\u9875\u9762 \u5f53\u4f60\u89e6\u53d1 history.back \u65f6\uff0c\u4f60\u5c06\u56de\u5230\u9875\u9762 b\u3002\u95ee\u9898\u662f\uff1a\u5982\u4f55\u4ece javascript \u4e2d\u5f97\u77e5\u4f60\u5f53\u524d\u5728\u5386\u53f2\u8bb0\u5f55\u4e2d\u7684\u4f4d\u7f6e\uff08\u5373 2\uff09\uff1f \u4f7f\u7528 javascript \u68c0\u6d4b\u5f53\u524d\u4f4d\u7f6e \u4ee5\u4e0b\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f46\u5b58\u5728\u517c\u5bb9\u6027\u95ee\u9898\uff1a \u76d1\u542c popstate \u4e8b\u4ef6 \u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u624b\u52a8\u7ef4\u62a4\u4e00\u4e2a\u5386\u53f2\u6808\uff0c\u4ec5\u9002\u7528\u4e8e\u5355\u9875\u5e94\u7528\u3002 \u4f7f\u7528 navigation api navigation api \u63d0\u4f9b\u4e86 navigation.entries() \u65b9\u6cd5\uff0c\u5b83\u8fd4\u56de\u4e00\u4e2a\u5386\u53f2\u8bb0\u5f55\u9879\u6570\u7ec4\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u65b9\u6cd5\u7684\u517c\u5bb9\u6027\u4e5f\u8f83\u5dee\u3002 \u517c\u5bb9\u6027 \u4f7f\u7528 popstate \u4e8b\u4ef6\u6216 navigation api \u7684\u517c\u5bb9\u6027\u5982\u4e0b\uff1a \u6d4f\u89c8\u5668 popstate navigation api chrome \u652f\u6301 \u652f\u6301 firefox \u652f\u6301 \u652f\u6301 safari \u652f\u6301 \u4e0d\u652f\u6301 edge \u652f\u6301 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-52719","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52719"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52719\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}