資源描述:
《2005 Ajax On Rails.pdf》由會員上傳分享,免費在線閱讀,更多相關內容在學術論文-天天文庫。
1、PublishedonONLamp.com(http://www.onlamp.com/)http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.htmlSeethisifyou'rehavingtroubleprintingcodeexamplesAjaxonRailsbyCurtHibbs06/09/2005Inafewshortmonths,Ajaxhasmovedfromanobscureandrarelyusedtechnologytothehot
2、testthingsinceslicedbread.Thisarticleintroducestheincrediblyeasy-to-useAjaxsupportthatispartoftheRubyonRailswebapplicationframework.Thisisnotastep-by-steptutorial,andIassumethatyouknowalittlebitabouthowtoorganizeandconstructaRailswebapplication.Ifyouneedaquick
3、refresher,checkoutRollingwithRubyonRails,Part1andPart2.Justincaseyou'vebeenstrandedonafarawayislandformostoftheyear,here'sthehistoryofAjaxin60secondsorless.Inthebeginning,therewastheWorldWideWeb.Comparedwithdesktopapplications,webapplicationswereslowandclunky.
4、Peoplelikedwebapplicationsanywaybecausetheywereconvenientlyavailablefromanywhere,onanycomputerthathadabrowser.ThenMicrosoftcreatedXMLHttpRequestinInternetExplorer5,whichletbrowser-sideJavaScriptcommunicatewiththewebserverinthebackgroundwithoutrequiringthebrows
5、ertodisplayanewwebpage.Thatmadeitpossibletodevelopmorefluidandresponsivewebapplications.MozillasoonimplementedXMLHttpRequestinitsbrowsers,asdidApple(intheSafaribrowser)andOpera.XMLHttpRequestmusthavebeenoneoftheWeb'sbestkeptsecrets.Sinceitsdebutin1998,fewsites
6、haveuseditatall,andmostdevelopers,iftheyevenknewaboutit,neverusedit.Googlestartedtochangethatwhenitreleasedaseriesofhigh-profilewebapplicationswithsleeknewUIspoweredbyXMLHttpRequest.ThemostvisuallyimpressiveoftheseisGoogleMaps,whichgivesyoutheillusionofbeingab
7、letodragaroundaninfinitelysizablemapinitslittlemapwindow.WhileGoogle'sprominentuseofXMLHttpRequestdramaticallydemonstratedthatvastlyimprovedUIsforwebappswerepossible,itwasJesseJamesGarrett'sFebruary18essaythatfinallygavethistechniqueausablename:Ajax(Asynchrono
8、usJavaScriptandXML).Thatwasthetippingpoint.Withoutknowingit,weasanindustryhadbeenwaitingforthis,andthenewAjaxnamespreadlikewildfire.Ihaveneverseensuchrapidandnearuniversaladoptiono