{"id":48940,"date":"2024-12-02T08:43:05","date_gmt":"2024-12-02T00:43:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/48940\/"},"modified":"2024-12-02T08:43:05","modified_gmt":"2024-12-02T00:43:05","slug":"jquery-%e5%9b%9e%e8%b0%83%e5%87%bd%e6%95%b0%e4%b8%ad%e4%b8%ba%e4%bd%95%e5%87%ba%e7%8e%b0-xml5619-%e9%94%99%e8%af%af%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/48940\/","title":{"rendered":"jQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>jQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f<\/h1>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300ajQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f\u300b<\/span>\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591a<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241104\/1730712467672893937ff49.jpg\" class=\"aligncenter\" title=\"jQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f\u63d2\u56fe\" alt=\"jQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>jquery \u56de\u8c03\u51fd\u6570\u4e2d\u65e0\u8fd4\u56de\u503c\u5bfc\u81f4 xml5619 \u9519\u8bef<\/strong><\/p>\n<p>\u5728\u8868\u5355\u63d0\u4ea4\u9875\u9762 formmessage.php \u7684 javascript \u4ee3\u7801\u4e2d\uff0c\u4f60\u4f7f\u7528\u4e86 $.ajax() \u65b9\u6cd5\u6765\u5411 domessage.php \u53d1\u9001\u5f02\u6b65\u8bf7\u6c42\u3002\u8be5\u65b9\u6cd5\u6709\u4e00\u4e2a success \u56de\u8c03\u51fd\u6570\uff0c\u5b83\u5728\u8bf7\u6c42\u6210\u529f\u65f6\u6267\u884c\u3002<\/p>\n<p>\u9519\u8bef\u63d0\u793a\u201cxml5619: \u6587\u6863\u8bed\u6cd5\u4e0d\u6b63\u786e\u3002\u201d\u8868\u793a\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u4e0d\u662f\u6709\u6548\u7684 xml \u6587\u6863\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u670d\u52a1\u5668 php \u4ee3\u7801\u4e2d\u8fd4\u56de\u4e86\u4e00\u4e2a\u9519\u8bef\u7684\u683c\u5f0f\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u68c0\u67e5 domessage.php \u4ee3\u7801\uff0c\u786e\u4fdd\u5b83\u8fd4\u56de\u4e00\u4e2a\u6709\u6548\u7684 json \u54cd\u5e94\u3002json \u54cd\u5e94\u5e94\u9075\u5faa\u4ee5\u4e0b\u683c\u5f0f\uff1a<\/p>\n<pre>echo json_encode(array('success' =&gt; true, 'message' =&gt; '\u6570\u636e\u5df2\u6210\u529f\u4fdd\u5b58'));<\/pre>\n<p>\u6b64\u5916\uff0c\u5efa\u8bae\u5728 $.ajax() \u65b9\u6cd5\u4e2d\u5c06 datatype \u5c5e\u6027\u8bbe\u7f6e\u4e3a &#8220;json&#8221;\uff0c\u4ee5\u660e\u786e\u670d\u52a1\u5668\u8fd4\u56de json \u54cd\u5e94\uff1a<\/p>\n<pre>$.ajax({\n  ...\n  dataType: \"json\",\n  ...\n});<\/pre>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300ajQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f \u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587\u300ajQuery \u56de\u8c03\u51fd\u6570\u4e2d\u4e3a\u4f55\u51fa\u73b0 XML5619 \u9519\u8bef\uff1f\u300b\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591a\u6587\u7ae0\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~ jquery \u56de\u8c03\u51fd\u6570\u4e2d\u65e0\u8fd4\u56de\u503c\u5bfc\u81f4 xml5619 \u9519\u8bef \u5728\u8868\u5355\u63d0\u4ea4\u9875\u9762 formmessage.php \u7684 javascript \u4ee3\u7801\u4e2d\uff0c\u4f60\u4f7f\u7528\u4e86 $.ajax() \u65b9\u6cd5\u6765\u5411 domessage.php \u53d1\u9001\u5f02\u6b65\u8bf7\u6c42\u3002\u8be5\u65b9\u6cd5\u6709\u4e00\u4e2a success \u56de\u8c03\u51fd\u6570\uff0c\u5b83\u5728\u8bf7\u6c42\u6210\u529f\u65f6\u6267\u884c\u3002 \u9519\u8bef\u63d0\u793a\u201cxml5619: \u6587\u6863\u8bed\u6cd5\u4e0d\u6b63\u786e\u3002\u201d\u8868\u793a\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u4e0d\u662f\u6709\u6548\u7684 xml \u6587\u6863\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u670d\u52a1\u5668 php \u4ee3\u7801\u4e2d\u8fd4\u56de\u4e86\u4e00\u4e2a\u9519\u8bef\u7684\u683c\u5f0f\u3002 \u89e3\u51b3\u65b9\u6848 \u68c0\u67e5 domessage.php \u4ee3\u7801\uff0c\u786e\u4fdd\u5b83\u8fd4\u56de\u4e00\u4e2a\u6709\u6548\u7684 json \u54cd\u5e94\u3002json \u54cd\u5e94\u5e94\u9075\u5faa\u4ee5\u4e0b\u683c\u5f0f\uff1a echo json_encode(array(&#8216;success&#8217; =&gt; true, &#8216;message&#8217; =&gt; &#8216;\u6570\u636e\u5df2\u6210\u529f\u4fdd\u5b58&#8217;)); \u6b64\u5916\uff0c\u5efa\u8bae\u5728 $.ajax() \u65b9\u6cd5\u4e2d\u5c06 datatype \u5c5e\u6027\u8bbe\u7f6e\u4e3a &#8220;json&#8221;\uff0c\u4ee5\u660e\u786e\u670d\u52a1\u5668\u8fd4\u56de json \u54cd\u5e94\uff1a $.ajax({ &#8230; dataType: &#8220;json&#8221;, [&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-48940","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48940","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=48940"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48940\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=48940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=48940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=48940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}