7-第8章 网络编程技术.ppt
文本预览下载声明
第8章 网络编程技术 8.1 JavaScript 8.1.1 一个最简单的JavaScript脚本 html head titleJavaScript练习/title /head body /body /html script language=JavaScript alert (Warning!我是JavaScript初学者!); /script 8.1.2 改变背景颜色 script language=JavaScript var MyColor; MyColor=prompt(您最喜欢的颜色是:,); switch(MyColor) { case 红色: document.bgColor=red; break; case 黄色: document.bgColor=yellow; break; case 灰色: document.bgColor=gray; break; default: alert(我不认识这些颜色!); } /script 8.1.3 显示日期和时间 script language=LiveScript today = new Date() document.write(现在时间是: ,today.getHours(),:,today.getMinutes()) document.write(br今天日期为: , today.getMonth()+1,/,today.getDate() ,/,today.getYear()); /script 8.1.4 弹出新窗口。 script language=JavaScript window.open(time.htm, 日期); /script 8.1.5 表单和函数 html head script language=LiveScript function WinOpen() { window.open(time.htm, 日期); } /script /head body form input type=button name=Button1 value=看看时间 onclick=WinOpen() /form /body /html 8.1.6 用JavaScript编制在线练习题目 英语形成性练习题 单向选择题,每题20分,共100分 1、You have to ___ your younger brother since mother is not at home. take care take after look after 2、You have to ___ the registration form in order to use that website. carry on fill in keep up 3、David, please ___ these books ___ to the libarary. take / back take / off take / out 4、If it rains, they will have to ___ the picnic. go through put off set off 5、I like ___ the radio. listening at listening for listening to ? script language=JavaScript function cal(theForm) { var score=0; if (theForm.R1.value ==c) score++; if (theForm.R2.value ==b) score++; if (theForm.R3.value ==a) score++; if (theForm.R4.value ==b) score++; if (theForm.R5.value ==c) score++; alert (你的得分是:+score*20+分); } /script * *
显示全部