{"id":1246,"date":"2005-12-31T16:11:56","date_gmt":"2005-12-31T08:11:56","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1246"},"modified":"2007-02-11T22:28:20","modified_gmt":"2007-02-11T14:28:20","slug":"ajax-%e5%82%b3%e9%80%81%e6%a0%bc%e5%bc%8f%e6%af%94%e8%bc%83","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1246-ajax-%e5%82%b3%e9%80%81%e6%a0%bc%e5%bc%8f%e6%af%94%e8%bc%83","title":{"rendered":"ajax \u50b3\u9001\u683c\u5f0f\u6bd4\u8f03"},"content":{"rendered":"<p>\u96d6\u7136\u6709\u4e86ajax framework\u4f86\u5373\u6642\u50b3\u9001\u8cc7\u6599\uff0c\u4f46\u662f\u9019\u500b\u8cc7\u6599\u7684\u683c\u5f0f\u8a72\u600e\u9ebc\u8fa6\u5462?\u5982\u679c\u9019\u500bajax\u61c9\u7528\u5f88\u7c21\u55ae\u7684\u8a71\uff0c\u4e5f\u8a31\u7528\u81ea\u8a02\u7684\u6587\u5b57\u683c\u5f0f\u5373\u53ef\uff0c\u4f46\u5982\u679c\u8907\u96dc\u4e9b\uff0c\u76ee\u524d\u6709\u4e09\u500b\u9078\u64c7\uff0cXML,HTML,JSON\u3002<\/p>\n<p><a href=\"http:\/\/www.quirksmode.org\/blog\/archives\/2005\/12\/the_ajax_respon.html\">The AJAX response: XML, HTML, or JSON?<\/a><\/p>\n<p><!--more--><\/p>\n<p>XML \u512a\u9ede\u662f\u8f03\u6a19\u6e96\u5316\u4e14\u4eba\u8f03\u6613\u4e86\u89e3\u683c\u5f0f\uff0c\u4e00\u822c\u8001\u624b\u53ef\u80fd\u4e5f\u6bd4\u8f03\u719f\u6089\u8655\u7406XML\u3002\u7f3a\u9ede\u662f\u524d\u53f0\u7528Javascript\u8655\u7406XML\u8f38\u51fa\u6210HTML\u4ecd\u5acc\u56c9\u5506 (XSLT\u7684\u89e3\u6cd5\u4f5c\u8005\u672a\u7814\u7a76)<\/p>\n<p>HTML \u512a\u9ede\u662f\u6700\u7c21\u55ae\u8655\u7406\uff0c\u56e0\u70ba\u524d\u53f0\u76f4\u63a5\u8f38\u51fa\u5c31\u597d\uff0c\u540c\u6642\u4e5f\u5f88\u5bb9\u6613\u6839\u64da\u4e0d\u540c\u524d\u53f0\u88dd\u7f6e\u8f38\u51fa\u4e0d\u540c\u7684HTML\u3002\u7f3a\u9ede\u662f\u5982\u679cHTML\u542b\u6709\u8868\u55aeforms\uff0cIE\u6703\u6709\u53ef\u6015\u7684\u932f\u8aa4\u3002\u53e6\u5916\u82e5\u8981\u914d\u5408\u9032\u968eCSS\u6280\u5de7\u4f7f\u7528\u7684\u8a71\uff0c\u53ef\u80fd\u6703\u8b93\u9019\u500bHTML\u8b8a\u5927\u8b8a\u8907\u96dc(\u56e0\u70ba\u8981\u52a0\u984d\u5916\u6a19\u7c64)<\/p>\n<p>JSON \u6bd4\u8f03\u7279\u5225\uff0cServer \u56de\u50b3\u4f9d\u500b string \u8868\u793a\u4e00\u500b Javascript \u7269\u4ef6(\u9019\u662fjavascript\u7684\u8a9e\u8a00\u7279\u6027)\uff0cclient\u53ea\u8981\u57f7\u884cevel\u5c31\u53ef\u4ee5\u62ff\u5230\u9019\u500b\u7269\u4ef6\u4e86\uff0c\u7136\u5f8c\u8dd1\u8f38\u51fa\u5373\u53ef\u3002\u512a\u9ede\u662f\u5b89\u5168\u6027\u8f03\u597d\uff0c\u907f\u514d\u4e86\u4e00\u4e9b\u5e38\u898b\u7684<a href=\"http:\/\/www.xml.com\/pub\/a\/2005\/11\/09\/fixing-ajax-xmlhttprequest-considered-harmful.html\">\u554f\u984c<\/a>\uff0c\u53e6\u5916\u6bd4\u8d77XML\uff0cJSON\u7684\u524d\u53f0 script \u53c8\u6bd4\u8f03\u7c21\u55ae\u4e00\u4e9b\u3002\u7f3a\u9ede\u662fJSON\u7684\u683c\u5f0f\u4eba\u8f03\u96e3\u8b80\uff0c\u6709\u4e00\u5806\u7684\u62ec\u865f\u5f15\u865f\u7b49\u7b49\u8981\u5728\u6b63\u78ba\u7684\u5730\u65b9\uff0c\u50cf\u662f <code><font face=\"Courier New\">}}]}<\/font><\/code> \u4e4b\u985e\u7684\uff0c\u5c0d\u65b0\u624bdebug\u4f86\u8aaa\u662f\u883b\u9ebb\u7169\u7684\u3002<br \/>\nJSON\u6700\u8fd1\u4e5f\u88ab Yahoo!&#8217;s \u4f5c\u70ba Web Service APIs \u683c\u5f0f\uff0c\u7b97\u662f\u883b\u7d05\u7684\u3002<\/p>\n<p>\u4f5c\u8005\u6700\u5f8c\u7d50\u8ad6\u662f\u6839\u64da\u4e0d\u540c\u74b0\u5883\u4f86\u505a\u9078\u64c7\u54ea\u500b\u6700\u597d\u56c9\uff0c\u6587\u7ae0\u7684Comments\u5247\u6709\u4e0d\u540c\u4eba\u7684\u6bd4\u8f03\u8a0e\u8ad6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u96d6\u7136\u6709\u4e86ajax framework\u4f86\u5373\u6642\u50b3\u9001\u8cc7\u6599\uff0c\u4f46\u662f\u9019\u500b\u8cc7\u6599\u7684\u683c\u5f0f\u8a72\u600e\u9ebc\u8fa6\u5462?\u5982\u679c\u9019\u500bajax\u61c9\u7528\u5f88\u7c21\u55ae\u7684 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1246-ajax-%e5%82%b3%e9%80%81%e6%a0%bc%e5%bc%8f%e6%af%94%e8%bc%83\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008ajax \u50b3\u9001\u683c\u5f0f\u6bd4\u8f03\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[33,5,4],"tags":[],"class_list":["post-1246","post","type-post","status-publish","format-standard","hentry","category-javascript","category-programming","category-web-design","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-k6","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=1246"}],"version-history":[{"count":0,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1246\/revisions"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}