{"id":1573,"date":"2006-12-19T22:33:54","date_gmt":"2006-12-19T14:33:54","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1573"},"modified":"2007-02-11T21:53:37","modified_gmt":"2007-02-11T13:53:37","slug":"pragmatic-ajax-a-web-20-primer","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1573-pragmatic-ajax-a-web-20-primer","title":{"rendered":"Pragmatic Ajax: A Web 2.0 Primer"},"content":{"rendered":"<p><a href=\"http:\/\/pragmaticprogrammer.com\/titles\/ajax\/index.html\"><img decoding=\"async\" src=\"http:\/\/images.amazon.com\/images\/P\/0976694085.01._SCMZZZZZZZ_V52808188_.jpg\" \/><\/a><\/p>\n<p>\u503c\u5f97\u63a8\u85a6\u7684AJAX\u5165\u9580\u597d\u66f8(2006\/3\u6708\u51fa\u7248)\uff0c\u5faa\u5e8f\u6f38\u9032\u4ea4\u4ee3\u51faJavascript\u3001DOM\u8ddfAjax\u3002\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\u6e05\u695a\u597d\u8b80\uff0c\u7db2\u9801\u8a2d\u8a08\u89c0\u5ff5\u6b63\u78ba\u3002\u8b1b\u5b8c\u7528 XMLHttpRequest\u00a0\u7684\u6700\u539f\u59cb\u7528\u6cd5\u4e4b\u5f8c\uff0c\u5c31\u958b\u59cb\u6559\u5982\u4f55\u904b\u7528 Prototype \u8ddf Dojo\uff0c\u7562\u7adf\u5be6\u5728\u4e0d\u9700\u8981\u7528 raw Javascript \u554a\u3002\u4e4b\u5f8c\u7684\u4f8b\u5b50\u4e3b\u8981\u4e5f\u662f\u7528 Prototype\u3002\u8b1b Ajax \u5982\u4f55\u6b63\u78ba\u4f7f\u7528\u7684\u89c0\u5ff5\u8b1b\u7684\u4e0d\u932f(\u7b2c\u4e03\u7ae0)\uff0c\u5176\u4ed6\u6709\u7528\u7684\u8b70\u984c(\u5982JSON)\u4e5f\u90fd\u5305\u542b\u5728\u5167\uff0c\u662f\u672c\u65e2\u5165\u9580\u5167\u5bb9\u53c8\u8c50\u5bcc\u7684\u66f8\u3002<\/p>\n<p>\u8a71\u8aaa\u9019\u672c\u66f8\u653e\u8981\u8b80\u6e05\u55ae\u653e\u597d\u4e45\u4e86\uff0c\u771f\u7684\u62ff\u8d77\u4f86\u8a8d\u771f\u770b\uff0c\u6c92\u5e7e\u5929\u4e5f\u5c31\u770b\u5b8c\u4e86\uff0c\u9084\u883b\u597d\u5538\u7684&#8230; :p<!--more--><\/p>\n<p>\u5927\u81f4\u7684\u5167\u5bb9\u662f\u9019\u6a23:<\/p>\n<ol>\n<li>\u7c21\u4ecb Ajax<\/li>\n<li>Google Maps \u7bc4\u4f8b (\u4f5c\u8005\u60f3\u8aaa\u660e\u9019\u53ea\u662f standard HTML and JavaScript \u800c\u5df2)\uff0c\u6211\u5012\u89ba\u5f97\u9019\u7ae0\u6709\u9ede\u7d2f\u8d05\u4e0d\u5fc5\u8981 :p<\/li>\n<li>XMLHttpRequest \u7684\u57fa\u672c\u7528\u6cd5<\/li>\n<li>XMLHttpRequest \u52a0\u4e0a\u00a0Javascript\u00a0DOM \u64cd\u4f5c<\/li>\n<li>Ajax Framework<br \/>\n\u4f5c\u8005\u628a Ajax Framework \u5206\u6210\u4e09\u7a2e\u5c64\u6b21<br \/>\n\u00a01.Ajaxian Web Frameworks(\u5982Rails,Tapestry,<a href=\"http:\/\/ASP.NET\" class=\"autohyperlink\">ASP.NET<\/a>)<br \/>\n\u00a02.UI Toolkit (\u5982Dojo,Backbase)<br \/>\n\u00a03.Remoting Toolkit (\u5982DWR,JSON-RPC)<br \/>\n\u63a5\u4e0b\u4f86\u4ecb\u7d39\u00a0Prototype \u8ddf Dojo \u7684 Ajax \u7528\u6cd5<\/li>\n<li>Ajax UI, Part 1:\u00a0Prototype,Script,aculo,us \u8ddf Dojo \u7684 DOM \u64cd\u4f5c\u8ddf\u7279\u6548\u7528\u6cd5<\/li>\n<li>Ajax UI, Part 2 : \u544a\u8a34\u4f60\u4ec0\u9ebc\u6642\u5019\u7528Ajax\u3002\u5148\u7d66\u4f60\u4e00\u4e9b Ajax Patterns \u7bc4\u4f8b(Server-side Validation\u3001\u8f09\u5165\u756b\u9762,\u8f09\u5165\u5b8c\u7279\u6548,Autocomplete\u7b49)\uff0c\u63a5\u4e0b\u4f86\u505a\u4e00\u4e9b\u8b70\u984c\u8a0e\u8ad6 (\u56de\u4e0a\u4e00\u9801\u3001Bookmarking\u3001GET is for getting,POST is for Doing \u7b49\u8a2d\u8a08\u6ce8\u610f\u4e8b\u9805)\u3002<\/li>\n<li>Debugging \u5de5\u5177\u4ecb\u7d39<\/li>\n<li>Degradable Ajax : \u8981\u5148\u6c7a\u5b9adegrade\u7684\u7a0b\u5ea6\u8ddf\u652f\u63f4\u7684\u7bc4\u570d\u3002<br \/>\n\u5148\u5f9e without Ajax \u958b\u59cb\u505a! \u7136\u5f8c\u518d Ajaxifying\u3002\u4f7f\u7528 HTML \u7576\u4f5c Ajax \u683c\u5f0f\u4e26\u642d\u914d partials template\u662f\u6bd4\u8f03\u5bb9\u6613\u505a\u597d Degradble Ajax\uff0c\u81f3\u65bc Web-Services-Driven Ajax (\u7528XML\u6216JSON\u683c\u5f0f) \u5247\u53ef\u80fd\u8981\u5206\u5169\u500b\u7248\u672c\u6216\u76f4\u63a5\u8aaasorry!\uff0c\u56e0\u70baclient side\u592arich\u4e86\u3002<\/li>\n<li>JSON \u8ddf JSON-RPC \u4ecb\u7d39\u00a0<br \/>\nJSON\u6bd4XML\u683c\u5f0f\u66f4\u5bb9\u6613\u8655\u7406\u800c\u4e14parsing\u53c8\u5feb\uff0c\u503c\u5f97\u6ce8\u610f\u7684\u662fJSON\u9084\u6709\u7368\u5230\u512a\u9ede\u5c31\u662f\u53ef\u4ee5\u8de8 server\u62ff\u8cc7\u6599\u3002<br \/>\nsee<a href=\"http:\/\/www.quirksmode.org\/blog\/archives\/2005\/12\/the_ajax_respon.html\"> The AJAX response: XML, HTML, or JSON?<\/a>\u00a0\u8ddf <a href=\"http:\/\/simon.incutio.com\/archive\/2005\/12\/16\/json\">JSON and Yahoo!&#8217;s JavaScript APIs<\/a><br \/>\nJSON-RPC \u5247\u662f\u62ff Rails \u7684 orbjson \u4f86\u793a\u7bc4\u3002<\/li>\n<li>Server-side Framework Integration \u7c21\u4ecb<br \/>\n\u4f5c\u8005\u53c8\u5206\u6210\u4e09\u7a2e<br \/>\n\u00a01.\u6709Visual Tool Support\uff0cview \u4f7f\u7528 components \u6a5f\u5236\uff0c\u5982ASP.NET,JSF toolkit for JAVA<br \/>\n\u00a02.Custom tag libraries(Helpers)\uff0c\u5982RoR\u7522\u751fJavascript code<br \/>\n\u00a03.ORB-like Remoting\uff0c\u76f4\u63a5\u5728client-side \u7528JavaScript\u547c\u53ebServer\u7aef\u7684function\uff0c\u5982JSON-RPC,DWR,PHP\u7684Sajax\u7b49<\/li>\n<li>Ajax with PHP : \u4ecb\u7d39 Sajax \u8ddf XOAD<\/li>\n<li>Ajax with Rails: \u5e7e\u500bAjax helpers\u4ecb\u7d39\uff0c\u6700\u5f8c\u63d0\u4e00\u4e0bRJS<\/li>\n<li>DWR with Spring(Java) : \u7565<\/li>\n<li><a href=\"http:\/\/ASP.NET\" class=\"autohyperlink\">ASP.NET<\/a> and Atlas : \u7565<\/li>\n<li>Ajax\u7684\u672a\u4f86<br \/>\n1. \u4ecb\u7d39<a href=\"http:\/\/zh.wikipedia.org\/wiki\/E4X\">E4X<\/a>(ECMAScript for XML)\uff0c\u4e00\u7a2eparse XML\u7684\u65b9\u5f0f\uff0c\u76f4\u63a5\u8b80\u51fa\u6210 object \u683c\u5f0f (\u6709\u9ede\u50cfJSON\u5728\u505a\u7684\u4e8b\uff0c\u53ea\u662f\u5c0d\u8c61\u662fXML)\u3002\u65e2\u6709XML\u6a19\u6e96\u683c\u5f0f\u7684\u597d\u8655\uff0c\u53c8\u6709JSON\u4e00\u6a23\u7684\u65b9\u4fbf\u6027\u3002<br \/>\n2. \u4ecb\u7d39\u756b\u5716\u7684 Canvas \u8ddf SVG (\u627e\u5230<a href=\"http:\/\/people.mozilla.com\/~vladimir\/xtech2006\/#slide1\">\u9019\u7bc7\u6295\u5f71\u7247<\/a>\u6bd4\u8f03\u5dee\u7570 )<br \/>\n3. \u700f\u89bd\u5668\u7aef\u7684 Local Storage \u80fd\u529b\uff0c\u6a19\u6e96\u53ef\u9760\u7684 offline storage API\uff0c\u76ee\u524d Dojo \u6709\u5728\u5be6\u4f5c\u3002<br \/>\n4. Flash Apollo : \u8b93 Flash \u4e0d\u9650\u65bc\u5728\u700f\u89bd\u5668\uff0cAdobe \u8981\u7528 Web \u6280\u8853\u9032\u8ecd<font size=\"2\">\u684c\u9762\u61c9\u7528 (see\u9019\u7bc7<a href=\"http:\/\/city.udn.com\/v1\/blog\/article\/article.jsp?uid=JerryTsai&amp;f_ART_ID=605357\">\u8a2a\u554f\u6587<\/a>\uff0c\u770b\u8d77\u4f86\u883b\u6709\u5438\u5f15\u529b\u7684)\u3002<\/font><br \/>\n5. Compiled Javascript \u63d0\u4f9b JIT Javascript compilation environment \u52a0\u5f37\u57f7\u884c\u901f\u5ea6<br \/>\n6. <a href=\"http:\/\/www.whatwg.org\/\">WHATWG<\/a> \u5c07\u4e3b\u5c0e\u4e86\u4e0b\u4e00\u4e16\u4ee3\u7684 web standards<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u503c\u5f97\u63a8\u85a6\u7684AJAX\u5165\u9580\u597d\u66f8(2006\/3\u6708\u51fa\u7248)\uff0c\u5faa\u5e8f\u6f38\u9032\u4ea4\u4ee3\u51faJavascript\u3001DOM\u8ddfAjax\u3002\u7bc4\u4f8b\u7a0b &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1573-pragmatic-ajax-a-web-20-primer\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Pragmatic Ajax: A Web 2.0 Primer\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":[9,33,5,4],"tags":[],"class_list":["post-1573","post","type-post","status-publish","format-standard","hentry","category-books","category-javascript","category-programming","category-web-design","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-pn","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1573","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=1573"}],"version-history":[{"count":0,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1573\/revisions"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}