欢迎来到天天文库
浏览记录
ID:9937731
大小:119.50 KB
页数:13页
时间:2018-05-16
《网页设计外文翻译》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、大连交通大学2013届本科生毕业设计(论文)外文翻译外文原文Source:WebPageDesignUsingJavaScriptTHEBASICSJAVASCRIPTusesasubsetoftheprogramminglanguageJAVAtoprovideahighlevelofinteractivityonawebpage.JavaScriptsarestoredwithinanHTMLdocumentandareinterpretedbythewebbrowser.JavaScriptsmaybelocatedwithintheHTMLcode
2、atthepointinthepagewheretheyaretoappearonthescreenortheymaybewrittenusingfunctions.FunctionsaresmallsubprogramsthatarestoredbetweentheheadtagsofanHTMLdocumentandarecalledontobeexecutedwhenaparticulareventoccurs.WhetherthescriptisstoredbetweentheheadtagsorwithinthebodyoftheHTMLdocu
3、ment,itmustbeenclosedinscripttags.Also,asetofHTMLcommenttagsaretypicallyusedinsidethescripttagssothatolderbrowsersthatdonotsupportJavaScriptwillignorethescriptandcontinuetoprocessthepagewithouterrors.Followingisanexampleofthescriptandcommenttags:BeawarethatJavaScriptiscasesensitive...thedifferencebetweenaworkingscriptandanerrormessagecanbeonecapitalletter.ALERTBOXESTopopupanalertboxincludethefollowinglineofcodeinsideofscripttagsinthebodyofyourHTMLdocument.Pleasenotethattheprocessingoft
5、hepagewillstopuntiltheviewerrespondstothealertbox.alert("Placethetexttobedisplayedinthealertboxbetweenthesequotes.")Othertypesofpre-madedialogboxesareavailablesuchasthepromptandconfirmboxes.InordertotakefulladvantageofthefeaturesofthesedialogboxesyoumustwritemoreJavaScriptcodewhic
6、hcanusethevaluesthatarereturnedbythedialogboxes.Thefollowingstatementswillpopupadialogboxthatrequiresayesornoanswer(OKorCancel).IftheanswerisOKthenthevariablenamedanswerhasavalueoftrueandiftheanswerisCancelthenthevariablenamedanswerhasavalueoffalse.YoucanthenuseanifstatementintheJ
7、avaScriptcodetorespondappropriately.13大连交通大学2013届本科生毕业设计(论文)外文翻译varanswer=confirm("Areyousureyouwanttoquit?")if(answer==true){window.close()}Thefollowingcodewillpopupadialogboxthataskstheusertoentersomesortofinformation.IftheuserclicksOKtheinformationtheyenteredisstoredinthevariab
8、le.Thesecondsetofquotationmarksin
此文档下载收益归作者所有