加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 Head First HTML5

Head First HTML5.pdf

Head First HTML5

187*****932@sina.cn
2014-03-25 0人阅读 举报 0 0 暂无简介

简介:本文档为《Head First HTML5pdf》,可适用于IT/计算机领域

AdvancePraiseforHeadFirstHTMLProgramming“HTMListhe“futureoftheweb”HowmanytimeshaveyouheardthatIfyoureallywanttounderstandthefamilyoftechnologiesthatmakeupHTML,readthisbook!HeadFirstHTMLProgrammingisthedefinitivebookonHTMLforeveryonefrombeginnerstoexperienceddevelopers”AaronLaBerge,CEO,FanzterInc“ThisbookisarollickingridethroughthewildnewterritoryofHTML,whereweareallboundtobebattlingscorpionsforyearsIttakesyouthroughbasicconceptssoyouunderstandthepurposesoftheHTMLdesign,andthenintoeachareasoyouknowyourwayaroundLikeallHeadFirstbooks,itreplacesdryrecitationwithlively,memorable,factladenburstsofinformationIwillalwayshavetheformalHTMLspecwebsiteforreferencepurposes,butI’drather*learn*itlively”KenArnold,DesignBuildHub,PeakImpact,Inc“AmusthavebookonHTMLwhichcontinuesontheHeadFirsttraditionofbeingwitty,fun,chockedfullofexamplesandwickedlysmart!”DannyMavromatis,SrSoftwareArchitect,ABCTelevisionGroup“HeadFirstHTMLProgrammingdoesagreatjobofmakingsenseofmanyofthekeyaspectsofHTMLinafun,easytodigestmannerWithitshighlyvisualstyleandnumerouscodesamples,complexconceptslikecanvasandasynchronousprogrammingaresimplifiedandillustratedmakingthemstraightforwardandengaging”MichaelSScherotter,PrincipalArchitectEvangelist,MicrosoftCorporation“HTMLisacakewithmanylayersoftechnologiesHeadFirstHTMLProgrammingbakesthatcake,andthenthrowsitatyourfaceYouwillconsumedeliciousnessandrejoice”JoshRhoades,cofounderofBrightHalfWithHeadFirstHTMLProgramming,themultiplicityofHTMLisapproachedwithamultiplicityinthemediumthatmakesthehardworkoflearningfunWardCunningham,wikiinventor“HTMListhehottestnewtechnologyforwebsitedevelopmentDevelopersfarandwidecan’twaittoputittousetobuildflexible,richmediawebsitesthatalsoworkgreatontabletsandsmartphonesHeadFirstHTMLProgrammingisthebestandfunnestwaytofeedthisexcitingnewtechnologytoyourbrainIhighlyrecommendit!”MarianneMarck,SVPTechnology,BlueNileIncAdvancePraiseforHeadFirstHTMLProgramming“Straightforward,informativeandentertaining,HeadFirstHTMLProgrammingisamustforanyonewantingtogetstartedwithHTMLorjusttorefreshtheirskillsTheHeadFirstserieshelpsmetokeepmytechnicalskillsuptodateallowingmetobettersupportmydevelopersandprojects”ToddGuill,ProjectManager,AllRecipescom“Thisain’tyourgrandpa’sDHTML!HeadFirstHTMLProgrammingpaintsahopefulandconfidentpictureofthefutureoftheWebthroughHTML,whileempoweringyoutocodeyourownticketthereIfyou’reseekingadefinitive,accessible,andattimesprettyfunnyguidebooktothisstandard,looknofurther”MannyOtto,WebProducerandCreative“TheauthorshavehitthenailontheheadJavaScriptskillsarethekeytoHTMLEvenifyou’veneverwrittenaJavaScriptprogrambefore,they’llquicklygetyouupandrunningthroughaseriesoffunandpracticalprojects”DavidPowers,authorofPHPSolutions:DynamicWebDesignMadeEasyPraiseforotherbooksfromEricFreemanElisabethRobson“Thisbook’sadmirableclarity,humorandsubstantialdosesofclevermakeitthesortofbookthathelpsevennonprogrammersthinkwellaboutproblemsolving”CoryDoctorow,coeditorofBoingBoingandauthorofDownandOutintheMagicKingdomandSomeoneComestoTown,SomeoneLeavesTown“Ifeellikeathousandpoundsofbookshavejustbeenliftedoffofmyhead”WardCunningham,inventoroftheWikiandfounderoftheHillsideGroup“Thisbookisclosetoperfect,becauseofthewayitcombinesexpertiseandreadabilityItspeakswithauthorityanditreadsbeautifullyIt’soneoftheveryfewsoftwarebooksI’veeverreadthatstrikesmeasindispensable(I’dputmaybebooksinthiscategory,attheoutside)”DavidGelernter,ProfessorofComputerScience,YaleUniversityandauthorofMirrorWorldsandMachineBeauty“IliterallylovethisbookInfact,Ikissedthisbookinfrontofmywife”SatishKumar“BewareIfyou’resomeonewhoreadsatnightbeforefallingasleep,you’llhavetorestrictHeadFirstHTMLwithCSSXHTMLtodaytimereadingThisbookwakesupyourbrain”PaulineMcNamara,CenterforNewTechnologiesandEducation,FribourgUniversity,Switzerland“HeadFirstHTMLwithCSSXHTMLisathoroughlymodernintroductiontoforwardlookingpracticesinWebpagemarkupandpresentationItcorrectlyanticipatesreaders’puzzlementsandhandlesthemjustintimeThehighlygraphicandincrementalapproachpreciselymimicsthebestwaytolearnthisstuff:makeasmallchangeandseeitinthebrowsertounderstandwhateachnewitemmeans”DannyGoodman,authorofDynamicHTML:TheDefinitiveGuide“TheWebwouldbeamuchbetterplaceifeveryHTMLauthorstartedoffbyreadingthisbook”LDavidBaron,TechnicalLead,LayoutCSS,MozillaCorporationhttp:dbaronorg“HeadFirstHTMLwithCSSXHTMLteachesyouhowtodothingsrightfromthebeginningwithoutmakingthewholeprocessseemoverwhelmingHTML,whenproperlyexplained,isnomorecomplicatedthanplainEnglish,andtheydoanexcellentjobofkeepingeveryconceptateyelevel”MikeDavidson,PresidentCEO,Newsvine,IncOtherrelatedbooksfromO’ReillyHTMLUpandRunningHTMLCanvasHTML:TheMissingManualHTMLGeolocationHTMLGraphicswithSVGandCSSHTMLFormsHTMLMediaOtherbooksinO’Reilly’sHeadFirstseriesHeadFirstC#HeadFirstJavaHeadFirstObjectOrientedAnalysisandDesign(OOAD)HeadFirstHTMLwithCSSandXHTMLHeadFirstDesignPatternsHeadFirstServletsandJSPHeadFirstSQLHeadFirstSoftwareDevelopmentHeadFirstJavaScriptHeadFirstAjaxHeadFirstRailsHeadFirstPHPMySQLHeadFirstWebDesignHeadFirstNetworkingHeadFirstiPhoneandiPadDevelopmentHeadFirstjQueryOtherO’ReillybooksbyEricFreemanandElisabethRobsonHeadFirstDesignPatternsHeadFirstHTMLwithCSSandXHTMLBeijing•Cambridge•K�ln•Sebastopol•TokyoEricFreemanElisabethRobsonHeadFirstHTMLProgrammingWouldn’titbedreamyiftherewasanHTMLbookthatdidn’tassumeyouknewwhattheDOM,events,andAPIswere,allbypagethreeIt’sprobablyjustafantasybuildingwebappswithjavascriptHeadFirstHTMLProgrammingbyEricFreemanandElisabethRobsonCopyright©EricFreemanandElisabethRobsonAllrightsreservedPrintedintheUnitedStatesofAmericaPublishedbyO’ReillyMedia,Inc,GravensteinHighwayNorth,Sebastopol,CAO’ReillyMediabooksmaybepurchasedforeducational,business,orsalespromotionaluseOnlineeditionsarealsoavailableformosttitles(http:mysafaribooksonlinecom)Formoreinformation,contactourcorporateinstitutionalsalesdepartment:()orcorporateoreillycomSeriesCreators:KathySierra,BertBatesEditor:CourtneyNashDesignEditor:LouiseBarrCoverDesigner:KarenMontgomeryProductionEditor:KristenBorgIndexer:EllenTroutmanProofreader:NancyReinhardtPrintingHistory:October:FirstEditionTheO’ReillylogoisaregisteredtrademarkofO’ReillyMedia,IncTheHeadFirstseriesdesignations,HeadFirstHTMLProgramming,andrelatedtradedressaretrademarksofO’ReillyMedia,IncManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc,wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcapsWhileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandtheauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedhereinNogumballswereharmedinthemakingofthisbookISBN:MToSteveJobs,whohypedHTMLtothepointwherethisbookshouldsellazillioncopiesAndtoSteveJobs,becausehe’sourheroviiitheauthorsAuthorsofHeadFirstHTMLProgrammingElisabethisasoftwareengineer,writer,andtrainerShehasbeenpassionateabouttechnologysinceherdaysasastudentatYaleUniversity,wheresheearnedaMastersofScienceinComputerScienceanddesignedaconcurrent,visualprogramminglanguageandsoftwarearchitectureElisabeth’sbeeninvolvedwiththeInternetsincetheearlydaysshecocreatedtheawardwinningWebsite,TheAdaProject,oneofthefirstWebsitesdesignedtohelpwomenincomputersciencefindcareerandmentorshipinformationonlineShe’scurrentlycofounderofWickedlySmart,anonlineeducationexperiencecenteredonwebtechnologies,whereshecreatesbooks,articles,videosandmorePreviously,asDirectorofSpecialProjectsatO’ReillyMedia,ElisabethproducedinpersonworkshopsandonlinecoursesonavarietyoftechnicaltopicsanddevelopedherpassionforcreatinglearningexperiencestohelppeopleunderstandtechnologyPriortoherworkwithO’Reilly,ElisabethspenttimespreadingfairydustatTheWaltDisneyCompany,wheresheledresearchanddevelopmenteffortsindigitalmediaWhennotinfrontofhercomputer,you’llfindElisabethhiking,cyclingorkayakinginthegreatoutdoors,withhercameranearby,orcookingvegetarianmealsYoucansendheremailatbethwickedlysmartcomorvisitherblogathttp:elisabethrobsoncomEricFreemanEricisdescribedbyHeadFirstseriescocreatorKathySierraas“oneofthoserareindividualsfluentinthelanguage,practice,andcultureofmultipledomainsfromhipsterhacker,corporateVP,engineer,thinktank”Professionally,EricrecentlyendednearlyadecadeasamediacompanyexecutivehavingheldthepositionofCTOofDisneyOnlineDisneycomatTheWaltDisneyCompanyEricisnowdevotinghistimetoWickedlySmart,astartuphecocreatedwithElisabethBytraining,Ericisacomputerscientist,havingstudiedwithindustryluminaryDavidGelernterduringhisPhDworkatYaleUniversityHisdissertationiscreditedastheseminalworkinalternativestothedesktopmetaphor,andalsoasthefirstimplementationofactivitystreams,aconceptheandDrGelernterdevelopedInhissparetime,Ericisdeeplyinvolvedwithmusicyou’llfindEric’slatestproject,acollaborationwithambientmusicpioneerSteveRoach,availableontheiPhoneappstoreunderthenameImmersionStationEricliveswithhiswifeandyoungdaughteronBainbridgeIslandHisdaughterisafrequentvistortoEric’sstudio,whereshelovestoturntheknobsofhissynthsandaudioeffectsEric’salsopassionateaboutkidseducationandnutrition,andlookingforwaystoimprovethemWritetoEricatericwickedlysmartcomorvisithissiteathttp:ericfreemancomElisabethRobsonixtableofcontentsTableofContents(Summary)TableofContents(therealthing)YourbrainonHTMLProgrammingHereyouaretryingtolearnsomething,whilehereyourbrainisdoingyouafavorbymakingsurethelearningdoesn’tstickYourbrain’sthinking,“Betterleaveroomformoreimportantthings,likewhichwildanimalstoavoidandwhethernakedsnowboardingisabadidea”SohowdoyoutrickyourbrainintothinkingthatyourlifedependsonknowingHTMLandJavaScriptIntroWhoisthisbookforxxiiWeknowwhatyou’rethinkingxxiiiAndweknowwhatyourbrainisthinkingxxiiiMetacognition:thinkingaboutthinkingxxvThetechnicalreviewteamxxxAcknowledgmentsxxxiIntroixGettingtoknowHTML:WelcometoWebvilleIntroducingJavaScriptandtheDOM:ALittleCodeEvents,HandlersandAllThatJazz:ALittleInteractivityJavaScriptFunctionsandObjects:SeriousJavaScriptMakingYourHTMLLocationAware:GeolocationTalkingtoTheWeb:ExtrovertedAppsBringingOutYourInnerArtist:CanvasNotYourFather’sTV:VideoWithSpecialGuestStar“Canvas”StoringThingsLocally:WebStoragePuttingJavaScripttoWork:WebWorkersAppendix:TopTenTopics(WeDidn’tCover)IndexxtableofcontentsWelcometoWebvillegettingtoknowHTMLUpgradetoHTMLTODAY!IntroducingtheHTMLoMatic,updateyourHTMLnow!You’reclosertoHTMLmarkupthanyouthinkHTMLExposed:ConfessionsofthenewestversionofHTMLWouldtheREALHTMLpleasestandupHowHTMLreallyworksWhoDoesWhatYourFirstMission:BrowserReconnaisanceWhatcanyoudowithJavaScriptWritingSeriousJavaScriptWritingSeriousJavaScriptRevisitedBulletPointsExerciseSolutionHTMLhasbeenonawildrideSure,HTMLstartedasameremarkuplanguage,butmorerecentlyHTML’sputonsomemajormuscleNowwe’vegotalanguagetunedforbuildingtruewebapplicationswithlocalstorage,Ddrawing,offlinesupport,socketsandthreads,andmoreThestoryofHTMLwasn’talwayspretty,andit’sfullofdrama(we’llgettoallthat),butinthischapter,we’refirstgoingtogoonaquickjoyridethroughWebvilletogetsenseforeverythingthatgoesinto“HTML”Comeon,hopin,we’reheadedtoWebville,andwe’regoingtostartbygoingfromzerotoHTMLinpages(flat)DragDropOfflineCachingGeolocationVideoCanvasFormsWebWorkersSocketshtmlheadtitlescriptbodyhphemAudioLocalStoragexitableofcontentsALittleCodeintroducingJavaScriptandtheDOMTheWayJavaScriptWorksWhatcanyoudowithJavaScriptDeclaringavariableHowtonameyourvariablesGettingExpressiveDoingthingsoverandoverMakedecisionswithJavaScriptMakingmoredecisionsand,addingacatchallHowandwheretoaddJavaScripttoyourpagesHowJavaScriptinteractswithyourpageHowtobakeyourveryownDOMAfirsttasteoftheDOMHTMLisFromMars,JavaScriptisfromVenusYoucan’tmesswiththeDOMuntilthepagehasfullyloadedSo,whatelseisaDOMgoodforanywayCanwetalkaboutJavaScriptagainOr,howtostoremultiplevaluesinJavaScriptThePhraseoMaticBulletPointsExerciseSolutionsJavaScriptisgoingtotakeyoutonewplacesYoualreadyknowallaboutHTMLmarkup(otherwiseknownasstructure)andyouknowallaboutCSSstyle(otherwiseknownaspresentation),butwhatyou’vebeenmissingisJavaScript(otherwiseknownasbehavior)Ifallyouknowaboutarestructureandpresentation,sure,youcancreatesomegreatlookingpages,butthey’restilljustpagesWhenyouaddbehaviorwithJavaScript,youcancreateaninteractiveexperienceor,evenbetter,youcancreatefullblownwebapplicationsGetreadytoaddthemostinterestingandversatileskillinyourwebtoolkit:JavaScriptandprogramming!xiitableofcontentsALittleInteractivityevents,handlersandallthatjazzGetreadyforWebvilleTunesGettingstartedButnothinghappenswhenIclick“AddSong”HandlingEventsMakingaPlanGettingaccesstothe“AddSong”buttonGivingthebuttonaclickhandlerAcloserlookatwhatjusthappenedGettingthesongnameHowdoweaddasongtothepageHowtocreateanewelementAddinganelementtotheDOMPutitalltogetherandtakeitforatestdriveReviewwhatwejustdidHowtoaddtheReadyBakeCodeIntegratingyourReadyBakeCodeBulletPointsExerciseSolutionsYoustillhaven’treachedouttotouchyouruserYou’velearnedthebasicsofJavaScriptbutcanyougetinteractivewithyourusersWhenpagesrespondtouserinput,theyaren’tjustdocumentsanymore,they’reliving,reactingapplicationsInthischapteryou’regoingtolearnhowtohandleoneformofuserinput(excusethepun),andwireupanoldfashionedHTML<form>elementtoactualcodeItmightsounddangerous,butit’salsopowerfulStrapyourselfin,thisisafastmovingtothepointchapterwherewegofromzerotointeractiveappinnotime““““xiiitableofcontentsExpandingyourvocabularyHowtoaddyourownfunctionsHowafunctionworksAnatomyofaFunctionLocalandGlobalVariablesKnowingthescopeofyourlocalandglobalvariablesOh,didwementionfunctionsarealsovaluesDidsomeonesay“Objects”!HowtocreateanobjectinJavaScriptSomethingsyoucandowithobjectsLet’stalkaboutpassingobjectstofunctionsObjectscanhavebehaviortooMeanwhilebackatWebvilleCinemaAddingthe“this”keywordHowtocreateaconstructorHowdoesthisreallyworkTestdriveyourconstructorrightoffthefactoryfloorWhatisthewindowobjectanywayAcloserlookatwindowonloadAnotherlookatthedocumentobjectAcloserlookatdocumentgetElementByIdOnemoreobjecttothinkabout:yourelementobjectsBulletPointsSeriousJavaScriptjavascriptfunctionsandobjectsCanyoucallyourselfascripteryet�ProbablyyoualreadyknowyourwayaroundalotofJavaScript,butwhowantstobeascripterwhenyoucanbeaprogrammerIt’stimetogetseriousandtakeitupanotchit’stimeyoulearnaboutfunctionsandobjectsThey’rethekeytowritingcodethatismorepowerful,betterorganizedandmoremaintainableThey’realsoheavilyusedacrossHTMLJavaScriptAPIs,sothebetteryouunderstandthemthefasteryoucanjumpintoanewAPIandstartrulingwithitStrapin,thischapterisgoingtorequireyourundividedattentionxivtableofcontentsGeolocationmakingyourhtmllocationawareLocation,Location,LocationTheLatandLongofitHowtheGeolocationAPIdeterminesyourlocationJustwhereareyouanywayHowitallfitstogetherRevealingoursecretlocationWritingthecodetofindthedistanceHowtoaddaMaptoyourPageStickingaPininitTheothercoolthingsyoucandowiththeGoogleMapsAPICanwetalkaboutyouraccuracy“Whereveryougo,thereyouare”GettingtheappstartedReworkingouroldcodeTimetogetmoving!You’vegotsomeOptionsTheworldoftimeoutsandmaximumageDon’tTryThisatHome(PushingGeototheLimit)Let’sfinishthisapp!IntegratingournewfunctionBulletPointsExerciseSolutionsWhereveryougo,thereyouareAndsometimesknowingwhereyouaremakesallthedifference(especiallytoawebapp)Inthischapterwe’regoingtoshowyouhowtocreatewebpagesthatarelocationawaresometimesyou’llbeabletopinpointyourusersdowntothecornerthey’restandingon,andsometimesyou’llonlybeabletodeterminetheareaoftownthey’rein(butyou’llstillknowthetown!)Heck,sometimesyouwon’tbeableto

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/49

Head First HTML5

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利