!
!
!
1!2345!"#$%&'#()*6!78'9!:;;!$&<=.>!$#>#$%#?9!!
"#$%&'#()*!,8?!.=#!"#$%&'#()*!;)<)!,$#!.$,?#0,$@>!)A!"#$%&'#()*6!78'9!:;;!).=#$!B$,8?!,8?!-$)?C'.!8,0#>!,$#!.$,?#0,$@>!)$!$#<&>.#$#?!.$,?#0,$@>!)A!.=#&$!$#>-#'.&%#!=);?#$>9!
!
Overview!
JavaScript*is*OO P*(O b ject*O rie nted*Programming)!D!this%means%you%build%sm aller%ob jects%that%make%up%the%whole.%There%
are$3!"flavors")of)JavaScript:!
!
49 E;.F"&?#!+,%,"'$&-.!GE"+"H!D!,8!#I.#8?#?!%#$>&)8!)A!+,%,"'$&-.!.=,.!#8,B;#>!.=#!#8=,8'#0#8.!,8?!0,8&-C;,.&)8!
)A!*#B!-,<#>!,8?!';.!B$)*>#$>!
!
29 "#$%#$F"&?#!+,%,"'$&-.!G""+"H!D!,8!#I.#8?#?!%#$>&)8!)A!+,%,"'$&-.!.=,.!#8,B;#>!B,'@F#8?!,''#>>!.)!.,B;#>6!
?,.,B,>#>6!A&;#!>J>.#0>6!,8?!>#$%#$>!G;&@#!.=#!,A)$#0#8.&)8#?!"#$%&'#()*!K;&?#L#')$?>H!
!
M9 E)$#!+,%,"'$&-.!D!.=#!B,>#!+,%,"' $&-.!;,8<C,<#!C>#?!BJ!B).=!';.!,8?!>#$%#$F>&?#!+,%,"'$&-.>9!
!
!
Core%JavaScript%encompasses%all%of%the%statements,%operators,%objects,%and%functions%that%make%up%the%basic%JavaScript%
language.(JavaScript(is(the$world's$most$popular$programming$language,$used$on$m ore$platforms$and$in$more$languages$
than%any%other%programming %langu age%in%history.%It's%been%licensed%by%more%than%175%comp anie s%for%inclusion%in%their%web%
tools.&JavaScript&is&even&available&as&a&standalone'scripting'language.!
!
As#you#can#see,#core#JavaScript#contains#objects#that#are#applicable#to#both#client#and#server.#If#you#know#core#JavaScript,#
you$can$easily$write$clientFside%and%ser verFside%JavaScript.%Again,%the%only%distinction%is%that%clientFside%and%serverFside%
JavaScript*have*additional*obje cts*a nd *fu nc tion s*th at*you*can*use*that*are*specific*to*clientFside%or%serverFside%
functionality.,Any,JavaScript,libraries,(.js,files),you,create,in,core,JavaScript,can,be,u sed ,on ,b oth ,the ,client,and ,the#server#
with%no%changes%whatsoever.!
!
When%writing%JavaScript,%you%have%to%follow%strict%syntax%rules.%While%white%space%means%nothing%when%you%are%coding%in,%
for$example,$HTML,$how$much$space$you$leave$between$words$or$paragraphs$doesn't$matter$!D!!the$“shape”'of'your'
HTML%code%doesn’t%matter.!
!
The$opposite$is$true$of$JavaScript$!D!!it#does#h ave#a#shape .#S o,#if#you#open #a#text#editor#and #ty p e :!
!
!
N>'$&-.!;,8<C,<#OP+,%,"'$&-.P!.J-#OP.#I.QR,%,>'$&-.PS!
NTFF!
?)'C0#8.9*$&.#GPNA)8.!');)$OU$#?USV=&>!7>!L#?!V#I.NQA)8.SPH!
QQ!FFS!
NQ>'$&-.S!
!
!
Stick!it#in!the!middle!of#some!HTML!code!and!you$get:!This!is!Red!Tex t !
!
document.write("<font!color='red'>This!Is!Red!Text</font>")!
!
So,$in$this$exam ple$JavaScript,$the$document,"in"this"case"the"HTML"document,"is"announced."The"document"will"be"altered"
by#writeFing$something$to$it.$What$will$be$written$to$the$document$is$inside$the$parentheses$!"#$%&'()%*%+,-+./-01234(54(
Red$Text</font>")!
!
Remember,'JavaScript'is'an'objectForiented$language!D!this%mea ns%functions%and%properties%are%grouped%into%logical%units%
called&objects.!
!