资源描述:
《网页制作教程 教学课件 作者 赵丰年 1_chap9-javascript and DHTML.ppt》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Chapter9JavaScriptandDHTML1ObjectivesExplainthe3layersofaWebdocument.InsertJavaScriptcodeonaWebpage.ExplainbasicJavaScriptsyntax.ExplainobjectsandJavaScriptobjects.ExplainDOM.Usecommonobjectssuchasdocument,window,form.Describetheeventhandlingmechanism.ExplainDHTML.ApplysimpleDHTMLon
2、yourpages.2WhyJavaScript?AWebpagethatissemanticallymarkedupandbeautifullydesignediswonderful,buttoreallymakeitanexperience,itneedssomeinteractivity.The3-layer:structural,presentationandbehavioral.3WhatisJavaScript?JavaScriptisaprogramminglanguagemainlyusedontheWeb.JavaScriptisnotJav
3、a.JavaScriptcanbeusedtotestbrowsers,respondtouseractivities,validateformdata,anddisplaycustomizedcontent(suchasfloatinganimation).4JavaScriptDosandDon’tsLikemanytools,JavaScriptcanbeusedforgoodorevil.TheevilusesofJavaScriptareallaround:rapid-firepop-upsthatopenfasterthanyoucancloset
4、hem,sitesthatautomaticallysetthemselvesasyourhomepage,thelistgoesonandon.AsWebprofessionals,wehaveadutytomaketheuserexperienceaspositiveaspossibleandmakeoursitesbothusableandaccessible.JavaScriptshouldbeusedinsuchaswaythatapageorsitecanbeusedwithoutit.5UsingJavaScriptJavaScriptcanbe
5、implementedonasinglepageoronanentiresite.AswithCSS,itcanbeembeddedinadocument,orexternalizedfromthatdocument.Seepage161.embeddedintheheadelementembeddedintagslinkedfromanexternalfile6SkillsNeededinProgrammingThefirsthardthingaboutprogrammingistolearn,becomecomfortablewith,andaccepts
6、omeartificialmechanisms,whethertheymake“sense”toyouornot.AttentiontodetailStupidityGoodmemoryAbilitytoabstract,thinkonseverallevels7AttentiontodetailInprogramming,thedetailsmatter.Youcan'tbevague;youcan'tdescribeyourprogram3/4ofthewayandthensay“YouknowwhatImean?”andhavethecompilerfi
7、gureouttherest.Youhavetodotyouri'sandcrossyourt's.Ifthelanguagesaysyouhavetodeclarevariablesbeforeusingthem,youhaveto.8StupidityComputersareincrediblystupid.Theydoexactlywhatyoutellthemtodo:nomore,noless.Whenyou'reprogramming,ithelpstobeableto“think”asstupidlyasthecomputerdoes,sotha
8、tyou'reintherightfr