{"id":52698,"date":"2024-12-03T17:13:30","date_gmt":"2024-12-03T09:13:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52698\/"},"modified":"2024-12-03T17:13:30","modified_gmt":"2024-12-03T09:13:30","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-js-%e5%92%8c-jquery-%e5%b1%80%e9%83%a8%e5%88%b7%e6%96%b0%e7%bd%91%e9%a1%b5%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52698\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f<\/h1>\n<p>\u79ef\u7d2f\u77e5\u8bc6\uff0c\u80dc\u8fc7\u79ef\u84c4\u91d1\u94f6\uff01\u6bd5\u7adf\u5728\u6587\u7ae0\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u662f\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u6ca1\u6709\u638c\u63e1\u597d\u800c\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u57fa\u7840\u77e5\u8bc6\u70b9\u7684\u79ef\u7d2f\u662f\u5f88\u91cd\u8981\u7684\u3002\u4e0b\u9762\u672c\u6587\u300a\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f\u300b\uff0c\u5c31\u5e26\u5927\u5bb6\u8bb2\u89e3\u4e00\u4e0b\u77e5\u8bc6\u70b9\uff0c\u82e5\u662f\u4f60\u5bf9\u672c\u6587\u611f\u5174\u8da3\uff0c\u6216\u8005\u662f\u60f3\u641e\u61c2\u5176\u4e2d\u67d0\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5c31\u8bf7\u4f60\u7ee7\u7eed\u5f80\u4e0b\u770b\u5427~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241122\/1732273063674063a77bfb7.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7528 js \u6216 jquery \u5c40\u90e8\u5237\u65b0\u7f51\u9875<\/strong><\/p>\n<p>\u4e3a\u4e86\u52a8\u6001\u66f4\u65b0\u7f51\u9875\u5185\u5bb9\uff0c\u800c\u4e0d\u5fc5\u91cd\u65b0\u52a0\u8f7d\u6574\u4e2a\u9875\u9762\uff0c\u53ef\u4ee5\u91c7\u7528\u5c40\u90e8\u5237\u65b0\u673a\u5236\u3002<\/p>\n<p><strong>div \u7684\u5c40\u90e8\u5237\u65b0<\/strong><\/p>\n<p>\u4f7f\u7528 jquery\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u5237\u65b0\u7279\u5b9a div \u7684\u5185\u5bb9\uff1a<\/p>\n<pre>$(\".dl\").load(location.href + \" .dl\");<\/pre>\n<p>\u8fd9\u5c06\u91cd\u65b0\u52a0\u8f7d div \u5bb9\u5668 &#8220;.dl&#8221;\uff0c\u5176\u4e2d location.href \u8868\u793a\u5f53\u524d\u9875\u9762\u7684\u5730\u5740\u3002<\/p>\n<p><strong>\u5168\u9875\u9762\u7684\u5237\u65b0\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4e5f\u9700\u8981\u5237\u65b0\u6574\u4e2a\u9875\u9762\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff1a<\/p>\n<ul>\n<li><strong>window.location.reload()\uff1a<\/strong>\u5237\u65b0\u5f53\u524d\u9875\u9762\u3002<\/li>\n<li><strong>parent.location.reload()\uff1a<\/strong>\u5237\u65b0 iframe \u6216\u6846\u67b6\u7684\u7236\u9875\u9762\u3002<\/li>\n<li><strong>opener.location.reload()\uff1a<\/strong>\u5237\u65b0\u6253\u5f00\u7a97\u53e3\u7684\u7236\u7a97\u53e3\u3002<\/li>\n<li><strong>top.location.reload()\uff1a<\/strong>\u5237\u65b0\u6d4f\u89c8\u5668\u9876\u5c42\u7a97\u53e3\uff08\u5373\u5305\u542b\u6240\u6709\u7a97\u53e3\u7684\u7236\u7a97\u53e3\uff09\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u6570\u9664\u4ee5\u4e00\u7ec4\u6570\u5b57\u5e76\u8f93\u51fa\u7ed3\u679c\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f \u79ef\u7d2f\u77e5\u8bc6\uff0c\u80dc\u8fc7\u79ef\u84c4\u91d1\u94f6\uff01\u6bd5\u7adf\u5728\u6587\u7ae0\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u662f\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u6ca1\u6709\u638c\u63e1\u597d\u800c\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u57fa\u7840\u77e5\u8bc6\u70b9\u7684\u79ef\u7d2f\u662f\u5f88\u91cd\u8981\u7684\u3002\u4e0b\u9762\u672c\u6587\u300a\u5982\u4f55\u4f7f\u7528 JS \u548c jQuery \u5c40\u90e8\u5237\u65b0\u7f51\u9875\uff1f\u300b\uff0c\u5c31\u5e26\u5927\u5bb6\u8bb2\u89e3\u4e00\u4e0b\u77e5\u8bc6\u70b9\uff0c\u82e5\u662f\u4f60\u5bf9\u672c\u6587\u611f\u5174\u8da3\uff0c\u6216\u8005\u662f\u60f3\u641e\u61c2\u5176\u4e2d\u67d0\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5c31\u8bf7\u4f60\u7ee7\u7eed\u5f80\u4e0b\u770b\u5427~ \u7528 js \u6216 jquery \u5c40\u90e8\u5237\u65b0\u7f51\u9875 \u4e3a\u4e86\u52a8\u6001\u66f4\u65b0\u7f51\u9875\u5185\u5bb9\uff0c\u800c\u4e0d\u5fc5\u91cd\u65b0\u52a0\u8f7d\u6574\u4e2a\u9875\u9762\uff0c\u53ef\u4ee5\u91c7\u7528\u5c40\u90e8\u5237\u65b0\u673a\u5236\u3002 div \u7684\u5c40\u90e8\u5237\u65b0 \u4f7f\u7528 jquery\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u5237\u65b0\u7279\u5b9a div \u7684\u5185\u5bb9\uff1a $(&#8220;.dl&#8221;).load(location.href + &#8221; .dl&#8221;); \u8fd9\u5c06\u91cd\u65b0\u52a0\u8f7d div \u5bb9\u5668 &#8220;.dl&#8221;\uff0c\u5176\u4e2d location.href \u8868\u793a\u5f53\u524d\u9875\u9762\u7684\u5730\u5740\u3002 \u5168\u9875\u9762\u7684\u5237\u65b0\u65b9\u6cd5 \u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4e5f\u9700\u8981\u5237\u65b0\u6574\u4e2a\u9875\u9762\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff1a window.location.reload()\uff1a\u5237\u65b0\u5f53\u524d\u9875\u9762\u3002 parent.location.reload()\uff1a\u5237\u65b0 iframe \u6216\u6846\u67b6\u7684\u7236\u9875\u9762\u3002 opener.location.reload()\uff1a\u5237\u65b0\u6253\u5f00\u7a97\u53e3\u7684\u7236\u7a97\u53e3\u3002 top.location.reload()\uff1a\u5237\u65b0\u6d4f\u89c8\u5668\u9876\u5c42\u7a97\u53e3\uff08\u5373\u5305\u542b\u6240\u6709\u7a97\u53e3\u7684\u7236\u7a97\u53e3\uff09\u3002 \u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002 \u5982\u4f55\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u6570\u9664\u4ee5\u4e00\u7ec4\u6570\u5b57\u5e76\u8f93\u51fa\u7ed3\u679c\uff1f<\/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-52698","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52698","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=52698"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52698\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}