WEB_网页编程技术_第4章 JavaScript.pdf
《WEB_网页编程技术_第4章 JavaScript.pdf》由会员分享,可在线阅读,更多相关《WEB_网页编程技术_第4章 JavaScript.pdf(17页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、?E-mail:pengliscfc.edu?4?JavaScript?4.1 JavaScript?4.2 JavaScript?4.3 JavaScript?4.4 JavaScript?4?JavaScript?4.1 JavaScript?Netscape?Web?LiveScript?Sun?Java?JavaScript?Livescript?JavaScript?HTML?JavaScript?Internet Explorer?Mozilla?Firefox?Netscape?Opera?4?JavaScript?4.1.1 JavaScript?1?JavaScript?2?
2、JavaScript?3?JavaScript?4?JavaScript?(event-driven)?5?JavaScript?Event?Event Driver?4.1.2 JavaScript?JavaScript?HTML?JavaScript?HTML?JavaScript?JavaScript?HTML?JavaScript?JavaScript?JavaScript?cookies?4?JavaScript?4.1.3 JavaScript?1?JavaScript?Java 2?JavaScript?VBScript 3.javaScript?Jscript?4?JavaSc
3、ript?4.1.3 JavaScript?1?Javascript?java?javascript?java?Java?JavaScript?Java?C?C+?4?JavaScript?4.1.3 JavaScript?3?Javascript?Jscript?web?html,?netscape?Navigator?LiveScript?JavaScript,Microsoft?jscript?internet explorer explorer?jscript?javascript?web?ECMAScript,?javascript?LANGUAGE=JavaScript?HTML?
4、4.2 JavaScript?3?1?2?_?$?3?4?JavaScript?4.2 JavaScript?4.2.3?:+,-,*,/,%,+,-,-(?:&,|,!?:=?=?,=,1&54?true 21&51|51|54,?true?3?true?false,?false?true?(21)?false?4.2 JavaScript?3.?:=?=?=?,=,=?x=“5”?true 4.2 JavaScript?4.?:=?+=?-=?*=?/=?%=?1?+=”?X=5?Y=5?X+=Y?10?X?2?-=”?X=5?Y=5?X-=Y?0?X?3?*=”?X=5?Y=5?X*=Y
5、?25?X?4?/=”?X=5?Y=5?X/=Y?1?X?5?%=”?X=25?Y=7?X%=Y?4?X?4.2 JavaScript?5.?1?1?2?2?true?1?false?2?day=“?4.2 JavaScript?6.?+?+”?太abc+“?abc?4.2 JavaScript?7.?1?*?/?%?2?+?-?3?=?=?=?!=?=)?4?&)?5?事事)?6?(?:)?(4*5+1822)?”?:”?4.2 JavaScript?8.?4.2 JavaScript?4.2.4?2?if-else?1?if(?)?2;?4.2 JavaScript?3?switch?4.
6、2 JavaScript?2?1?for?4.2 JavaScript?2?while?while(?)?for(var i=1;i=3;i+)document.write(“”);?document.write(i+”.”+prompt(?末+i?太?末);?3?do-while?while?dowhile?do?;?;while(?)?4?break?continue?break break?Continue continue?The number is 0 The number is 1 4.2 JavaScript?3?(?for(variable in object|array)st
7、atements?1?for-in?with?variable:?object?array?for(?in?)?object,array:?Math?function=Math.cos(3*Math.PI)+Math.sin(Math.LN10)ForInDemo()x/?2?with?Math.E)y=Math.tan(14*var a,key,s=;/?with(?)a=“a”:“Athens”,“b”:“Belgrade”,“c”:“Cairo”/?a.a,a.b,a.c?with?/?with(Math)for(key in a)x=cos(3*PI)+?3?return?s+=ake
8、y+ sin(LN10)/s+=key+“ ”;/?a b c”?s?y=tan(14*E)?/?/*?*/?4?return(s);?4.2 JavaScript?4.2.4?JavaScript?1?function?(?1,?2)?2?3?return?4.?4.2.5?JavaScript?name=Hege“name=Hege?document.write(Hello World!)?document.write (Hello World!)?”b?var txt=“We are the so-called”Vikings“from the north.docum
9、ent.write(txt)JavaScript?We are the so-called Vikings from the north.4.3 JavaScript?JavaScript?Math?String?Date?Time?Array?window?4.3 JavaScript?4.3.1 Math?Math?new?Math.?(?)1?Math?(?P347)2?Math?(?P347)3?Math?:?math.htm 4.3 JavaScript?4.3.2 String?0?JavaScript?太末?String?String?String?4.3 JavaScript?
10、1?String?(?)?str1=hello;?new?:str2=new String(hello);2?String?length(?)3?String?String?4.?1:?2:?3:?-indexof?4:?4.3 JavaScript?4.3.3 Date?JavaScript?Date?1?Date?var?=new Date(?)?,Date?:var myDate=new Date()/?2?Date?4.3 JavaScript?3.?1?Date()?date1.htm?2:?date2.htm?3:?1970?:getTime.html?4:?:setFullYea
11、r.html?5:?:clock.html 4.3 JavaScript?4.3.4 Array?JavaScript?Array?1?Array?:?new?var Tips=new Array(6);2.Array?:?:?var mycars=new Array()/?mycars0=Saab mycars1=Volvo mycars2=BMW?var mycars=new Array(3)/?3 mycars0=Saab mycars1=Volvo mycars2=BMW?:?var mycars=new Array(Saab,Volvo,BMW)3.?:?var mycars=new
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- WEB_网页编程技术_第4章 JavaScript WEB_ 网页 编程 技术
限制150内