{"id":2249,"date":"2024-11-10T16:49:51","date_gmt":"2024-11-10T08:49:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2249\/"},"modified":"2024-11-10T16:49:51","modified_gmt":"2024-11-10T08:49:51","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-javascript-%e5%92%8c-jquery-%e5%ae%9e%e7%8e%b0%e5%b1%80%e9%83%a8%e5%92%8c%e5%85%a8%e9%a1%b5%e9%9d%a2%e5%88%b7%e6%96%b0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2249\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 JavaScript \u548c jQuery \u5b9e\u73b0\u5c40\u90e8\u548c\u5168\u9875\u9762\u5237\u65b0\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173069910345953.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 JavaScript \u548c jQuery \u5b9e\u73b0\u5c40\u90e8\u548c\u5168\u9875\u9762\u5237\u65b0\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 JavaScript \u548c jQuery \u5b9e\u73b0\u5c40\u90e8\u548c\u5168\u9875\u9762\u5237\u65b0\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0<\/strong><\/p>\n<p>\u5728 web \u5f00\u53d1\u4e2d\uff0c\u5c40\u90e8\u5237\u65b0\u662f\u6307\u53ea\u66f4\u65b0\u7f51\u9875\u7684\u7279\u5b9a\u90e8\u5206\uff0c\u800c\u5176\u4ed6\u90e8\u5206\u4fdd\u6301\u4e0d\u53d8\u3002javascript \u548c jquery \u63d0\u4f9b\u4e86\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0\u7684\u65b9\u6cd5\u3002<\/p>\n<p><strong>div \u5c40\u90e8\u5237\u65b0<\/strong><\/p>\n<p>\u8981\u5237\u65b0<\/p>\n<p> \u5143\u7d20\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b jquery \u4ee3\u7801\uff1a <\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>$(\".dl\").load(location.href+\" .dl\");<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c$(&#8220;.dl&#8221;) \u9009\u62e9\u8981\u5237\u65b0\u7684<\/p>\n<p> \u5143\u7d20\uff0c\u800c location.href+&#8221; .dl&#8221; \u6307\u5b9a\u8981\u52a0\u8f7d\u7684\u5185\u5bb9\uff0c\u5373 \u7684\u5185\u5bb9\u3002 <\/p>\n<p><strong>\u5168\u9875\u9762\u5237\u65b0<\/strong><\/p>\n<p>\u5982\u679c\u9700\u8981\u5237\u65b0\u6574\u4e2a\u9875\u9762\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b javascript \u65b9\u6cd5\uff1a<\/p>\n<pre>window.location.reload()<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u5237\u65b0\u5f53\u524d\u9875\u9762\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u65b9\u6cd5\u53ef\u4ee5\u5237\u65b0\u4e0d\u540c\u7684\u5bf9\u8c61\uff1a<\/p>\n<ul>\n<li>parent.location.reload()\uff1a\u5237\u65b0\u7236\u5bf9\u8c61\uff08\u7528\u4e8e\u6846\u67b6\uff09<\/li>\n<li>opener.location.reload()\uff1a\u5237\u65b0\u7236\u7a97\u53e3\u5bf9\u8c61\uff08\u7528\u4e8e\u5355\u5f00\u7a97\u53e3\uff09<\/li>\n<li>top.location.reload()\uff1a\u5237\u65b0\u6700\u9876\u7aef\u5bf9\u8c61\uff08\u7528\u4e8e\u591a\u5f00\u7a97\u53e3\uff09<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 JavaScript \u548c jQuery \u5b9e\u73b0\u5c40\u90e8\u548c\u5168\u9875\u9762\u5237\u65b0\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0 \u5728 web \u5f00\u53d1\u4e2d\uff0c\u5c40\u90e8\u5237\u65b0\u662f\u6307\u53ea\u66f4\u65b0\u7f51\u9875\u7684\u7279\u5b9a\u90e8\u5206\uff0c\u800c\u5176\u4ed6\u90e8\u5206\u4fdd\u6301\u4e0d\u53d8\u3002javascript \u548c jquery \u63d0\u4f9b\u4e86\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0\u7684\u65b9\u6cd5\u3002 div \u5c40\u90e8\u5237\u65b0 \u8981\u5237\u65b0 \u5143\u7d20\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b jquery \u4ee3\u7801\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b $(&#8220;.dl&#8221;).load(location.href+&#8221; .dl&#8221;); \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c$(&#8220;.dl&#8221;) \u9009\u62e9\u8981\u5237\u65b0\u7684 \u5143\u7d20\uff0c\u800c location.href+&#8221; .dl&#8221; \u6307\u5b9a\u8981\u52a0\u8f7d\u7684\u5185\u5bb9\uff0c\u5373 \u7684\u5185\u5bb9\u3002 \u5168\u9875\u9762\u5237\u65b0 \u5982\u679c\u9700\u8981\u5237\u65b0\u6574\u4e2a\u9875\u9762\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b javascript \u65b9\u6cd5\uff1a window.location.reload() \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u5237\u65b0\u5f53\u524d\u9875\u9762\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u65b9\u6cd5\u53ef\u4ee5\u5237\u65b0\u4e0d\u540c\u7684\u5bf9\u8c61\uff1a parent.location.reload()\uff1a\u5237\u65b0\u7236\u5bf9\u8c61\uff08\u7528\u4e8e\u6846\u67b6\uff09 opener.location.reload()\uff1a\u5237\u65b0\u7236\u7a97\u53e3\u5bf9\u8c61\uff08\u7528\u4e8e\u5355\u5f00\u7a97\u53e3\uff09 top.location.reload()\uff1a\u5237\u65b0\u6700\u9876\u7aef\u5bf9\u8c61\uff08\u7528\u4e8e\u591a\u5f00\u7a97\u53e3\uff09 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 JavaScript \u548c jQuery \u5b9e\u73b0\u5c40\u90e8\u548c\u5168\u9875\u9762\u5237\u65b0\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-2249","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2249","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=2249"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2249\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}