欢迎来到课桌文档! | 帮助中心 课桌文档-建筑工程资料库
课桌文档
全部分类
  • 党建之窗>
  • 感悟体会>
  • 百家争鸣>
  • 教育整顿>
  • 文笔提升>
  • 热门分类>
  • 计划总结>
  • 致辞演讲>
  • 在线阅读>
  • ImageVerifierCode 换一换
    首页 课桌文档 > 资源分类 > DOCX文档下载  

    JavaScript教程 解释型或即时编译型的编程语言.docx

    • 资源ID:1415058       资源大小:87.38KB        全文页数:77页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    JavaScript教程 解释型或即时编译型的编程语言.docx

    JavaScript.1.Thau!CGI一Javascript,CGIavascript-WEB-JavascriptJavascript,_-Perl,C,C+JavaJavasript.Page1:Javascript.Page2:.Page3:-Page4:.JaVaSCriPtPage5:-2.:.Thau!-3Javascript.Javascript一JavascriptQ.if-then.JavasriptJavaJavascriptJavascriptJavascript-Javascript-3.0一3d-Javascript.Javascript.1.:Javascript.2.:.3.:.4.:.JavaScript.5.:.3.:.Thau!JavaScript,<title>.<head>.HTM1.JavaScript-HTM1.-JavaScript.HTMI_一JavaScript.<scriptIanguage=nJavaScriptnX.Ianguage=zzJavaScriptzz.JavaScript一J1.*alert("better,stronger,faster,.Javascript._.<scrt>.1.:Javascript.2.:.3.:.4.:JaVaSCriPt.5.:-.4.JavaScript.Thau!,<script>JTM1.JavaScript- /putupanalertbox,toshowhowtheyworkalert("Soo,IW川OVerthrOWmybrowser!");第2章Congratulations.,.HTM1. <html><head><title>blahblahblah<title><scriptlanguage="JavaScript"><!-hidethisstufffromotherbrowsers.1.:Javascript.3:r;.JaVaSCriPt5,:-.5.:.Thau!JavaScript. JavaScript. JavaScript. JavaScript- Q JavaScript.JavaScriptJavaScript JavaScript. JavaScript. JavaScript.Page1:Javascript.Page2:.Page3:.Page4:.JaVaSCriPtPage5:.JavaScript2.Thau!JavaScript-JavaScript一l2.::3Q.4.:.5.:.6.:if-then.7.:if-then.8.:if-then.9.:.10.:.11.:2.12.:.Thau!JavaScript-"x=21""x""y=x+31",y,-5.-JavaScript.<scriptlanguage=JavaScriptz*><!-hideme-JavaScript-/loadupsomevariablesvarsecs_per_min=60;varmins_per_hour=60;varhours_per_day=24;vardays_per_year=365;.var.ar_.Somonkey_23.JavaScript±oop.loop.-SeCSPerMin.x,y1.hack_hack_hack.一JavaScript-JavaScript.Webmonkey-/dosomecalculationsvarsecs_per_day=secs_per_min*mins_per_hour*hours_per_day;varsecs_per_year=secs_per_day*days_per_year;-JavaScript.secs_per_year.60,60,24,365-变量secs_per_year./endhiding><script>JavaScript.JavaScriptJavaScript.l2.:r3A:.5.:.6.:if-then.7.:if-then.8:if-then.9.:.10.:.11.:温.12.:._.Thau!<scriptIanguage-zzJavaScript,z><!一hidemeJavaScript./here,showtouseJavaScripttowriteoutHTM1.document,writein(zz<b>Themonkeydances);document,writein(secs_per_year);document,writein(,secondsperyear,<b><p>zz);document.writeln().document,writeln().<script>.<script>jdocument.writein(blah!)JHTM1.secs_per_year.JavaScript-_secs_per_yearJavaScriptJavaScript(,document.write1n(zzsecs_peryearz,).JavaScript.secs_per_year_31,536,000.document,writeInO.HTM1.<b>.<b>.-JavaScript.(secs_per_min).secs_per_minJavaScript.document,writein(secs_per_min).JavaScript.Ir2.:,3.l.4.:.5.:.6.:if-then.7.:if-then.8.:if-then.9.:.10.:.11.:2.12.:r.4.Thau!varnice_monkey="ThemonkeysmilesatyouandrecitesShakespeare.varbad_monkey="Themonkeyscowlsatyouandburps."document,writein(nice_monkey);varmonkey=prompt(z,What,sthemonkey,sname?","Themonkeyz,);-OK.-What'sthemonkey'sname?Themonkey'1.varmonkey=prompt(zzWhat,sthemonkey*sname?","");vartechymonkey=monkey+demanding+tech;zrtechymonkey"Themonkey"+"demands,no,insistsuponreceiving"+"acomputerthatwon,tcrash,andahomemadebrowser!"vartechy_monkey-monkey+demanding÷tech;vartechy_monkey-"Themonkeydemands,no,insistsuponreceivingacomputerthatwon,tcrash,andahomemadebrowser!,;varitalic_hippy=hippy_monkey.italics();varshouting-hippy=hippy_monkey.toUpperCase();varred_bold_tech-bold_tech.fontcolor(,red,);varitalic_hippy="<i>"+hippymonkey+”<i>”;JavaScript.document.writein(italic_hippy).JHTM1.-hippymonkey.string,fontcolor(,newcolor,)varred_bold_tech=zz<fontCOlor='red'>+bold_tech+</font>varred_bold_tech-bold_tech.fontcolor(,red,);document,writein(bold_tech+<br>");varbrokenbold=bold_tech+”<br>”;document,writein(brokenbold);2:,.4.:.5.:.6.:if-then.7.:if-lhen-B.:if-then,.9.:.10.:r.11.:z2.12.:r5二.Thau!.HTM1.<body>and<body>j11ad-lib.51if-the.l2.:.3j.4.:.5.:.6.:if-then.7.:if-then.8.:if-then.9.:.10.:r.11.:J.12.:.6Jif-then.Thau!"if-then"_if(someconditionistrue)(dosomething;dosomething;dosomething;."if",(if.).-if-then-.if-then.1,2.::3.1.4.:.5.:-.6.:if-then.7.:if-then.8.:if-then.9.:.10.:r.11.:2.12.:r.7«.if-then.Thau!.yes.varmonkey_love=prompt(,zDoyoulovethemonkey?","Typeyesorno");if(monkey_love=yes)alert(zzWelcome!msogladyoucame!Please,readOri!);)Jnonkey_love_jnonkey_love."yes".JavaScriptJ11onkey-love."yes".(variable_l>variable_2)istrueifvariable_lisgreaterthanvariable_2(variable_l<variable_2)istrueifvariable_lislessthanvariable_2(variable_2<=variable_2)istrueifvariable_lislessthanorequaltovariable_2(variable_l!=variable_2)istrueifvariable_ldoesnotequalvariable_2if(variable>18)&&(variable1<21)document,writeIn(/zvariable_lcanvote,butcan,tdrink.");.&&JavaScript一if(variable-l="bananas")(variable_l="JavaScript")document,writein(,zThemonkeyishappybecauseithas+variable_l);.if-then.!2: .?3:4: ,.6.:if-then.7.:if-then.B.:if-hen.9.1.10.:r.11.:z2.12.:8.:if-thenExercise.Thau!广.1,.2.:.4.:.5.:.6.:if-then.7.:if-then.8.:if-then.9.:.10.:.11,:.2.12.:r.Tha!JavaScript«onClick,一OnMoUSeoVer.<script>_.onClick.onMouseOver.JavaScripts-JavaScripts-JavaScripts-OnClick-<ahref=#onClick-,zalert(,0oo,doitagain!?)/>Clickonme!<a>-OnCIiCk二JavaScriptsalert_JIref=_<ahref=#onMouseOver=z,alert(,Heehee!j)z>Mouseoverme!</a>.OnMouseOver.onClick.2.:r.4.:.S:.6.:if-then.7.:if-hen.B.:if-then.9.:.10.:r.11.:/.12.:.10.:.Thau!OneofthemostcommonlyusedfeaturesofJavaScriptistheabilitytochangeimagesonamouseover.Unfortunately,MicrosoftInternetExplorer3.0doesnotsupportimagereplacement.Soifyou'reusingIE3.OzitmightbetimetoupgradetoIE4.0orswitchtoNetscape.JavaScripts-.IE3.0-IE4.0.Netscape3.0.1.et'sgothroughtheexamplestepbystep.Thefirstlineofinterestis<imgsrc="button-r.gif,'name="thejmage">ThisisjustlikeaStandardexceptthisonehasbeengivenaname:Thisnamecouldbeanything:my_image,a_boxzwhatever-butitcan'thaveanyspacesinit.<imgsrc=>.the_image.my_image,a_boxz.Thenextlineofinterestis<ahref="#"onMouseOver="document.the_image.src='button_d.gif'">change</a>Thisiswheretheimageswaphappens.It'sjustliketheousawbefore.TheactivepieceofJavaScript,whichappearsinthequotesoftheisthis:OnMouseOver.onMouseOver.JavaScript.document.thejmage.src=,button-d.gif,;Thisstatementsaysz"findtheimagecalledandchangeitstoNotethattherearedoublequotesaroundthewholestatement,andtakessinglequotes.Althoughquotesareinterchangable,ifyouhaveonesetofquotesinsideanothersetofquotes,thesetshavetobeofdifferentkinds.SoyoucouldeitherdobutnotGotit?Jthe-image,.src.button_d.gif."_竺Utton_d.gif_."'something'".'"something",.",something",or""something",1.Justastherewasalotofdetailinwhatmakesdocument,writein()work,mnottellingyouexactlyhowthisimageswapisworking.You'lllearnthedetailsofbothwhenwelookatobject-orientedprogrammingandtheDocumentObjectModelinthenextlesson.document,writein().Animportantcaveataboutimageswappingisthattheimageyou'reswitchingtoshouldbethesamesizeastheoriginal.Ifit'snot,it'llgetsmashedorstretchedtofittheoriginal'ssize.Ir2,:,3?if-then.if-thenif-then.A.:,.6.:i.7.:iB.:i.9.:.10.11.12.11.;2.Thau!3.IE2.:r3.14:.5.:.6.:if-hen.7.:if-thenB.:if-then.9.:.10.:r.11,:.2.12.:.12.:.Thau!document.writeln().document,writeinO.HTM1.prompt.prompt.if-then-else.if-then-else.JavaScript.href.onClick.OnMouseOver.JavaScript.:JavaScriptJavaScript.frames,.lr2.:3.1.4.:.5.:.6.:if-then.7.:if-then.8.:if-then.9.:.10.:.11,:.2.12.:r.5.:.Thau!ljavascript.ThaUJaVaSCriPt.ThauJavaScript1.ThaUJaVaSCriPt.,.JavaScript”ThaUJaVaSeriPt.ThaUJaVaSCriPt.1.rJHTM1.<body>and<body>j11ad-lib.1.if-then-.l.2.:.4,:.5.:.6.:ifthen.7.:if-then-.8.:if-then.9.:.10.:.11.:.12.:rJavaScript.3.Thau! JavaScript.HTM1. .JavaScript.HTM1. JavaScript,if-then._window,document,monkeyimage,src二,happymonkey,gifz,Jiappymonkey,gif.monkeyimage._window.document.?.src.?.,.document.Writel.n("monkey").document,writein.writeIn?-(JavaScriptDocumentObjectMode1.DOM'DOM.JavaScript.JavaScript二DOM.JavaScript-DOM.,JavaScript.1423:.=.4.:JavaScript.5.:WindoWS.6.:JaVaSCriPt-.7.:.8.:.9.:JaVaSCriPtDoM.10.Window.Frame.11.12.13.2j.Thau!JavaScript-HTMI_,.href_HTM1.:clickingon<ahref-z,yernewwindow.htm,target=z,yernewwindowv>thislink<a>willopenanotherwindow.J'yer_new_window""yer_new_window'1.herf.URIHTM1._yer_newwindow.2%3.::A:.5.:.6.:.href.,JavaScript.JavaScript.WindOwS.JaVaSCriPt-.7.:(8.:«.9.::.10.11.12.13.JaVaSCriPtDoM.Window.Frame.3JavaScript.Thau!.HTMIJavaScript-window.OPen("UR1.","name","features");-UR1.-UR1."http:WwW.hotwired,com/WCbnlOnkey”.UR1.-ope-.features-JavaScript.1.,3.:.4.:.5J.6.:;.7.:.8.:.9.:JavaScript.WindOWS.JaVaSCriPtJavaScriptDOM.11.12.13.Window.Frame.4j.Jav_.Thau!.javascript_l-.javascript_2.javascript_l.HTM1.<ahref="#"onClick=,zwindow,open(,javascript_window_l.htm,javascript-l,);z,>Here,sawindownamedjavascript_l<a>,.javascript-l.javascript_window_l.html.features-.onClick-window,open().onClick-<script>.windows.open().-HTM1.<ahref="#"OnCIiCk="window,open(,javascript_window_2.html','javascript_2,);zz>Here,sawindownamedjavascript_2<a>.-HTMIjavascript_l.<ahref="#"OnCliCk="window,open(,javascriptwindow3.htm,javascript)>Here,sanotherHTM1.pagegoingintojavascriptl<a>.-featuresOK.windowsfeaturesJ.1.2 .1.3 :=.4.:JavaScript.5.:Windows,.6.:JavaScript.7.:.B.:.9.:JaVaSCriPtDOM.10.:r.11.:.WindOW.Frame.12.:?.13.:r5.Thau!window,open()window.OPer1(Someur1,“windowname","location,menubarzz);-URIwindow,open(z,someurlz,windowname","location,height=100,width=100z,);-100-menubar.status.一URl_marqueescrollbars.resizable.width.heighttoolbar.Homebutton,amongothers.-HOME.location.UR1.directories.2.3.4.5.6.7.8.Netscape."What'snew,""What'scool,".JavaScript.WindOWS.JaVaSCriPt-.9.:JaVaSCriPtDoM.10.:r.11.:,Window.Frame.12.:r.13.:.6JavaScript"DOM.Thau!-JavaScriptDOM-.-JavaScript.-JavaScriptJavaScript-Window-一UR1.-JavaScript-window-varthe_status=window,status;.windowstatus-the_status-status_window,status=Tmmonkeyingaround!,;.1.23.4.5.6.7.8.9JavaScript.Windows.JavaScript,JaVaSCriPtDOM.10.11.12.13.Window.Frame.Tha!错误!超级链接引用无效。错误I超级链接引用无效。<ahref="#"onMouseOver=z,window.status=1Monkeys!,>Whodowelove?</a>.widow.open("UR1.,",ame,""features")Javascriptjpen-varitalic_hippy=hippy_monkey.italics();-italics().一alert.prompt一window,alert(,Vivalaprimate!,7);-VivaIaprimate!.错误!超级链接引用无效。Itseemssortofsillytojustblurthewindowthatyou'relookingat.Inordertousefocusandblurmoreusefully,youneedtoknowhowtoinvokemethodCaIlSonotherwindows.1423 :M.4.:JavaScript.5.:WindOWS.6.:JaVaSCriPt-.7.:.4 .:-.9.:JaVaSCriPtDOM.10.:.11.:.Window.Frame.12.:r.13.:r-.Thau!-javascript.varnew_window=window,open(zzhello.html”,htm1.name“width=200,height=200/z);_newwindow.new_window_JIeW.window.newwindow.:newwindow,blur();.window,blurO.<ahref=#onMouseOver=,new_window.focus()z>Bringitforward<a><ahref=#onMouseOver=,new_window.blur()/z>Putitbackward</a>.l.?2-3:=.4.:JavaScript.5.:WindoWS.6.:JaVaSCriPt.7.:,.8.:.9.:JavaScriptDOM.10.:r.11.:,WindOvV.Frame.12.:s.13.:.9二.Thau!JavaScript-document.HTM1.-document-imageswap)<ahref=#onMouseOver=,window.document.the_image.src-button_d.gif,;zz>change<a>.window.document.the_image3rc-butt0n.d.gif.windows.d。CUmentStodOCUmenl.images.-JavaScript.DocumentObjectMode1.2.1.3.:4.::5二.6.::JavaScript.WindOWS.7.:,8.::.9.:.10.11.12.13.JaVaSCriPtDoM.WindoW.Frame.JaVaSCriPt-0.:.Thau!"FramesAreaPicnic.".JavaScript-javascript-.javascript-<framesetrows=z,25%,*><framesrc=zzframes_examp1e_contro1s.htmlname=,control_frame/z><frameSrC="blank.htmlname-z,target_framez,><frameset>control_frame,.-javascript.HTM1.-src=#.:COntrO1_frame_<ahref=#onClick=z,top.targetframe,document,writeln(,Monkeydo!<br>>);”>Monkeysee<a>JavaScript-_target_frame.docume1.JavaScript-document.writelnOJ1Monkeydo!".writeln().document-.document.writein().writein().*U2。3:=.4.:JavaScript.5.:Windows.6.:JavaScript,.7.:.B.:-.9.:JaVaSCriPtDOM.10.:?.11.:.Window.Frame.12.:r.13.:.11.:-.Thau!-top.-top.zparent.-2-parent.一javascript.1.?2,3.:.4.::.5.1.6.:.7.:.8.:.9.:JavaScript.Windows.JaVaSCriPt-JaVaSCriPtDoM.10.:.11.:.WindoW.Frame-.12.:?.13.:.12.:.Thau!-2-.document-bgco1O-HTM1.body.document.“red:.16.#FFoOO0JavaScript-3.1.,2;3.:=.4JavaScript.5.:Windows.6.:JaVaSCriPt-.7.:-.8.:.9.:JaVaSCriPtDoM.10.:-.11.:.WindOW.Frame.12.:r.13.:.13.:.Thau!DocumentObjectMode1.JavaScript.-DomainObjectModel)-DOM.-HTM1.1.,2.3.:.4.:.5.:.6.:.7.:.8.:.9.:JavaScript-Windows.JaVaSCriPtJaVaSCriPtDoM.10.:r.11.:Window.Frame.12.:.13.:=Javascript.:.Thau!Javascript_2Jf-then-Javascript-Javascript_Page1:-Page2:.Page3:.Page4:.WHI1.E.Page5:-Page6:.Page7:.Page8:.Page9:.PageIOlPage11:.Page12:-Page13:.Page14:-.Thau!varthe_password="passthewrench"varanswer=prompt("What,sthewoyd?"/'");if(answer!=the_password)answer=prompt(,What'sthewoyd?","");if(password!=the_password)document.write("Youlose!<p>");elsedocument.write("That,sright!<p>");elsedocument.write(,That,sright!<p>");if-then.(loop)while.passthewrench.1.:.2.:r3.:.4,:.WHI1.E.5.:For.6.:,.7.:.8.:.9.:.10.11.:r.12.:,.13.:,.14.”.Thau!Javascript-varpassword="passthewrench"varanswer;-answer一answer.while(answer!=password)answer=prompt("What'sthewoyd?"/'");.while.while-while(sometestistrue)dothestuffinsidethecurlybraces.answer.Password(Passthewrench)-(aswer!=password)-answe1.while-answer-answer-.1.:.2.:?3:.4.:.WHI1.E.5.:For.6.:.7zr.8.:.9.:.10.11.:r.12.:?.13.:,.14.:r.4.While1.oops.Thau!varwidth=prompt(z,Howmany,swouldyoulike?(1-10isgood)”,"5);vara_line=;varloop=0;while(loop<width)(a_line=a_line+x;loop=loop+l;alert(a_line);while(loop<width)(a_line+="x"

    注意事项

    本文(JavaScript教程 解释型或即时编译型的编程语言.docx)为本站会员(夺命阿水)主动上传,课桌文档仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知课桌文档(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-1

    经营许可证:宁B2-20210002

    宁公网安备 64010402000986号

    课桌文档
    收起
    展开