資源描述:
《ajax in action first steps with ajax》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、iTePub.Net-CollectFirststepswithAjaxThischaptercovers■IntroducingthetechnologiesbehindAjax■UsingCascadingStyleSheetstodefinelookandfeel■UsingtheDocumentObjectModeltodefinetheuserinterfacestructure■UsingXMLHttpRequesttoasynchronouslycontacttheserver■Puttingt
2、hepiecestogether31LicensedtojonathanzhengiTePub.Net-Collect32CHAPTER2FirststepswithAjaxInchapter1wefocusedonusersandhowAjaxcanassistthemintheirdailyactiv-ities.Mostofusaredevelopers,andso,havingconvincedourselvesthatAjaxisaGoodThing,wene
3、edtoknowhowtoworkwithit.Thegoodnewsisthat,aswithmanybrand-new,shinytechnologies,mostofthisprocesswillbereasonablyfamiliaralready,particularlyifyou’veworkedwiththeInternet.Inthischapter,we’llexplaintheAjaxtechnology.We’lldiscussthefourtechnologicalcornerston
4、esofAjaxandhowtheyrelatetooneanother,usingcodeexamplestodemonstratehoweachtechnologyworksandhoweverythingfitstogether.Youmightliketothinkofthischapterasthe“helloworld”sectionofthebook,inwhichweintroducethecoretechnologiesusingsomesimpleexamples.We’remoreint
5、erestedhereinjustgettingthingstowork;we’llstarttolookatthebiggerpictureinchapter3.Ifyou’realreadyfamiliarwithsomeoralloftheAjaxtech-nologies,youmaywanttoskimthesesections.Ifyou’renewtoAjaxandtowebclientprogramming,theseintroductionsshouldbesufficienttoorien
6、tyoufortherestofthebook.2.1ThekeyelementsofAjaxAjaxisn’tasingletechnology.Rather,it’sacollectionoffourtechnologiesthatcomplementoneanother.Table2.1summarizesthesetechnologiesandtherolethateachhastoplay.Table2.1ThekeyelementsofAjaxJavaScriptJavaScriptisagene
7、ral-purposescriptinglanguagedesignedtobeembeddedinsideapplications.TheJavaScriptinterpreterinawebbrowserallowsprogrammaticinter-actionwithmanyofthebrowser’sinbuiltcapabilities.AjaxapplicationsarewritteninJavaScript.CascadingStyleCSSoffersawayofdefiningreusa
8、blevisualstylesforwebpageelements.ItoffersaSheets(CSS)simpleandpowerfulwayofdefiningandapplyingvisualstylingconsistently.InanAjaxapplication,thestylingofauserinterfacemaybemodifiedinteractivelythroughC