Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
362 views

Javascript Handwritten Notes

Uploaded by

Ishaan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
362 views

Javascript Handwritten Notes

Uploaded by

Ishaan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 28
* Sepipki ¥ © @atulkumarx| | svipting Languones [CAMS ..,,, 2 Qeatutumars These ave Spavalinad pregrammmang layguages wie | ort used enhance -fandionalily ond oppssmane ob ssh pages | These ave hoo pes / = Chien! -Side samphing lavgage used J Simple validections ot client - side. = Sevvar -Sidd sexiphiug lorguage used f2t datihate vebtceten Seri phiug languages cUenk-side Server-Side vBseiel Jscvipt govascript ASP Served ¥ © @atulkumarx ISP 2 legs Ths is Used 5 imeludet me Sewet inte html doument. Amok: Zsevipl language =" nome of Sedol > 2 The Sewpphing -lomguoges cou usecl [8 Modify document's Conlink dynamically. D Fovaceript WS @ client-side Sevoting language - CODING BUGS ENOTES GALLERY Scanned with CamScanner ay bye ova Seri pk gu which is designed IS enkane uncktonalily ob vsckpogy That ave dowtopad with HTML= Tavasewpt is a clcewk ~ Side evi pling lavigusge. D> Similovies behuan govaterigt ome JOS + Ls Goth have same Eid oF operalars, Ly Simay couhel Shrucbaces. Ls concepts nh obgedks ond matheds ort Sinthar. 2D Digherences Lehuana sorascript avid Java p- Ly seve is am cbyatt -Buienkid when gavaseriet | is am obgeth-basad Sevipkvg language + L5 sou sasue code Us compiled ysl ond MAM inlivprakad, vllere Toaseript Code is nat only iulipyeted - Note py rae obgect — based programming Layguaye, ut comple Com ude prya-defined objects only. The obgect —Stienlid programming language Suprot ts cvealé news obgeds and f wy Me byes s S Benifits desovaseripl s- in web broosert Ly widely Supported L need & Speval page” fe | Ly sb Senjasd dow! uy «your Sem pts J Lo af giws Mme eaty aceots Je document obgett a com ost oe Them. — SICODING BUGS ENOTES GALLERY Scanned with CamScanner X Vesta bles t= A voriable is a named locatd that usted. to dove any value fal That parteuley progyom + Rales 4A Naming Tht variable :- pegin with & letter & digit BL Unde wierdee- —> Names Musk > spaces ove not allowed in bebucen vaicable Mame: SS Names ave Case Somsidive - wow VA aS vertabl Name+ red by using one Kays > Reserved werd = ALL Voriabls Can be dat he “yea”. Efe Var ay Vay sume 107 * Datatypes SICODING BUGS ENOTES GALLERY jous cenipl superts ellewtng dotaliypos on Ls Numeric a tie ° Ly strings — Ney an heey £0. | Ly Bealann, vey num ~ Small vt name“ 7 vey ages null; 4 wuld % Qperolas im Java senpt :- | Ls pvimmelic operalasi- — b> Reledional operalovst- + — > Addition <> Less than | - = Substraction > > Grade Than / X > Mulkpi ation ez lassie a equel to f= Division de ~ gras thay ayquel © = “f. a Modulus Ly Logical © Koes: Raballly poulbs :- ga > logical AND > 1s qual © Vy > Logical oR > ty nek eyual te - Scanned with CamScanner © Programming iim Tava sexipts + Examplti- The qeollesing enample preg rerr disploys im Nalmol ext « | | eHHe> Samp . a! 4i-- This ndicales he comment --> deowunent vovitily Cis is my Rest pesann"): decumeut « amitely (CY alba l gavo.sonpt')” Tgenaglt « Wan gaya sevipt | | < Ino boo © Sommpu gavo sev pl 7 Pf | Th Ta above encmple, . S esenpt > tag is used to theluding Me Stvipt ile This ig my ofrsh prgvom abrk yao sever html doument. BS Valen - >", tag iy URE Fo disploy a ob He Conmel Text « DS deument- wii” bs ad FE cLisplay some (axl 0 et ‘ EAD Nol A gin) practin te deploy thy Sevieh th rma HEA vegio"l se Tk HTML Code - Scanned with CamScanner Example: the Jalluang script damonshats Ma adelition end substradion cb hus num bert: chim > Sevipt te addition and Subtraction < HtL> As abot | = . | j vet My Ma, add, Sub! Ns boy nels; add= Nem Sub =M-ny dowaments worileln (addition is" Fadd)s tourments vovitily Ccubbedion ie 4 Sub) Z1Sej pt> Alhaad> ipi- S\CODING BUGS ENOTES GALLERY ¢ Th oddilion 2 Sublocltoa ¥ f | Aciton is as | sublackion 6 S | { Th Te emampl, ox Can assign te voIMns alivodtly to veowables, fwntioa tae Gin! CHa alee provide These volaits ynoemieally | dering sum Hime. tina Number 6 be | TW do That, rust xeplau Tae Code tom F by felsiny code - Scanned with CamScanner fy = parse Tak Cuvindas « promt CO ewliv my volar” 3): wy > parse Zak Cusindews - prompt Celis Ma volua")); 1 The eokpuk will be genonated to Window «prompt — Tk coutes a small windms [6 be displayed on comsdle - > paseInt - Tt is used fo convert the givom sting iw Tabijav + Similoaly > parserloot - Le is und te convavt @ givan Shing feeding volun nde a Scanned with CamScanner ¥ Conditioval Stelawewts:— Ls & stalemewt: = Ls else -i4 ladder :— Sywlex'- 3b CConditien) Saul Lp Condition) i L Statements: Statiments; t elta i¢Cconditiw Ly Yrelso stabmewks t _ Stekiments 5 Syalox:- Uf Ceondition) ? q aise stat ; eae Stolements else 4 t staltmonks » I Example ~ spy fellowsay aman ple. vas mantmum ve Three Num ~ ears : SCODING BUGS ENOTES GALLERY ; ELit> manimum o& ZB numbers ny = parseTak (winders: prompt (elev nivel) J) Ng = porseTal(cuivdrs: proMPEL™ Entiw vig vole ))> ok (n> ML ARM OME? dousmant: willy maximum is ands else CMD My FH MPMI | daumink, wibly Umoximun iy? +7 | 3 else. Nie aly douamtuk. woitaloy {Y marina FAI? Scanned with CamScanner elseniet> s 2 body > < [body > ethkml> ap Scanned with CamScanner x Looping Stale monty — Lo while stalaments— aegin | | whik Ccondition) | £ Staliments; | 4 Ly do-whik stalement :— sywlox- do { “Staliwtends F wii: (condehion Ls 4a stotiwenk syntax 48 Ciniticl vation; conditions inevoment/decrement) L Resin Stehwwenks 5 tn a False | i Edt | | Tut. L | [Eaertmtel] peace * Byanching Shliment - L sutten Caseim — Sywlie- Sei tel ( Ru pression) L case 11 stolimenks > brat; cose 27 Stolament; ereute; defeuth Sabrent, & Scanned with CamScanner vi bor. Exampl t-te tind Jorrdrof a given Number. | ett > | cheod> | ZAM (o > Jorbdiod <1 blb> | woe | | << scxipk — lemguoge = “Joes wp > iy ant nif adel | | Ne parseTnk Lusindane « pomp’ C evley a number]): \ | . _ 43 \ | ab( nero) | | * soastansts writ Crfackivel is "1° f else aliens (eens trad a foots adh #15 Pa . ces cos la Ugearkiae) i to)? 1 | 4 | 2 WSeviph > | | Z bedy> |

Ey plore utey pen Eydiv a nureber Scanned with CamScanner | % Functions \ A function 1s a sel}- coudained block ob Slate wed tak pertim a pettaday tase. | Bosically,functoms ae tus types, They ore > pradafined furdions > Usev defined enchous Ly pre defined aunctiong — These ave alse called as global functions, becouse They cam be callid and used ty any part ob a program. > isFink Os Kwually The about. fonction fates tha numeric Value os am adygument and rebar true owby iF he quis cogument results a ferrite numeric else if %eharns false Exampll’-—jspinike (Sho)! 7» TE nelins false > isnancye © Te mien shut slates only Sb ta on gumente is nk a number, cle i nelivas o false satcu. Exampl’ sna (0); > Th rekions true, > pouedaho Te acept, Shing as argument and Comunts | iW ify Sguivalant ~ nunete, Example. panseTak (iow; 3 Tk converts (9 1@02 — porsaploatty: Tr aaceapts String as omgumtule and comme dts ke ih equivalyak locking yalus i Bompl:- parce pleat (1); 3 neo | > eal , ub, it is aed | Te lees ao Sting ay an oyume Te ape evaliting The Shing . Scanned with CamScanner Framplt~ Eyal (2.%8) —) Th melins &. Ls user defined —fanetions to _ hese Juwdens ame difivid by User by va predated bryurdted “ancien”, Cork th these fundions cam have JAaing => Junchon name > Lise of poremelirs > ust de Stalimonts > Relarn ype Sywax funition Jundion — Nera C parawylirs) 14 Stalivarntss Zhtml> ZATL> Example far feurctions Z/te? Zseripk language =‘ gavaser et” > Vor a a= parseTuk (usindeu prompt L" ext & num") doumenks writin C’ spun xf gtuen he a” sh sqeet co) ouume wh sti | a it e + wl s tvam ne hg e es cubeta); Junction gqusu CK) Scanned with CamScanner t | ven 2 | Cz KKEK kK roku ©) 4 Zisemel> 2 theod > 2lhtwl> | function cube CK) | | eS bx Obgects in ova, sexipk t= Uses check -dueubed - comlapts : wohid obsec is noting oq olley autres - ouejos Ta Tm oval which | can, depart We Ta, Tava sonek obseks | deka and cundiont+ once, The gave sedge gehs Space & su sevad fai “Gack obbgacks axe. Stoved - where. tks dunckiont The Jovaseripk Suprortt Doumenk obgeck t- ae wid dowmert mesa te the silt dtsqlasys Ma, broustey waindeas | Tr had fellewivy methods | > Wie / Writely (- Tw Usd 5 display Me fExt on I Bxample- a dowsmerc. vont (“ yoi" I, Ai tad Scanned with CamScanner Ty todays wsdtld clmask all pragramming Long vages conteurt Vnleivg enoulid, o Sparel moby bulk an ently, dota. ond page which chuemonts A &f usiudns. closeo + al te process (Gr elements th frm, Exempt! — douumantacdms (dam~- namely > Unks O6~ a is used to Llebpage « Exon: clourmert. Enks 00> hold He number ob Unes th => closetr:- Te u used 6 step tuserenk proais on Me dotument. Exava — dourmouk. clese Cd 5 Ly Window hye 1 / “Te Wag a Hele bar, message , defaull (eon, writ one BL wae Command ufos Te Supprrts felleuseuy mattinds fe hod PD OPN” TE is ated G open a new poindaa DF 4u30 Sgumonts | \Rese oe > URL i catetsd => Name wit fd iH — Windaus ope (Tua , “namel) F SEO Tie used te cecall” Te edtadeus easily - Ue Mas shoo oyumens , thote tt > x- co&divall y - Cobtdi nolh.. EX Windmas Serell (100, 185) + D> promt ays ua be Seer loysl ithe ie user by dispayty Seat voinden- EX Windma. prompt ("emir a value"): 2D cote op te uted te Clnge me cuvent de" Scanned with CamSeanner | b> Math obyeck i ™ che math obgetl have Ta ditteak pes eb matkals. those aut uted To penvdiim several MoThemedion) cablastalins. | Te has qelmaing sydax, Math « method (numeric velists) | sre owing oe FHopuoubly used mathematical melReds . 3 mmo Te acsplays Ma minimum dk two numeric values. ex: doumenks UAE (Mathemin (19SI)2 Moje © D> maxd)e TE displays the onium ERY doumeut. ene c Mat: max (1orS)); MHeze- 10 tuo numbers > abscuin- Tr meting Me absolali vols th % Ex dowment- wv (Marth. abs Cus); Heer 43 SD c&lOyi- TE reblivns Me nesmesl- iwligey nok (esy (han x. CE gouamenk « wile (Mame CHLOE); Mole & dowment« candle Cate Cal (G0, HM ove 6 => romd(n)i- qe Tekurns ta veorest i ’ ER gowments writ (mata. rows (s-6)5 epee & document. on & (maths yaund (6-09; Leyes > Moov) s— Ak satinens. wea nesstest ibeger nek greeter Than. EX" douumant. writ (math floor (5-8) 5 Nope doumerk. cont (Matfer CSD); I eres” PEO TE sutusns pray ob one velit’ : Evy doussnent. cite ( memm «pases Hop: & ~ Scanned with CamScanner | PsgTtOr Tp veliwns Ta guert crook ok given Mumber. | Ex: doument- citi (math seb la2 Me 3 sive, Value > sinto'~ ge mobaens digenome dae dowmeut. usw le ( Math aSinlQo))? I Me= I Qusns digowemebic CoS value. AL Cuath. Cos (oI) ueyo. | tan volus - a > cos It mw gx! document +2 | > lam yt Te selans tvigevomedte bx douwment. voit CMath lam (usd), W%p 3 > bog! TE relivns leg odtionic equally vole ERS dauument « coil, (Mah » log 62-91); Sie va Ly sting obgeet t= Ty geno Kew: enclcod under debi. quelt. The Minsing ave frequently used hing mottiads | ms sting reader la Sones ok choxocbnt > lp Lowey ase Ot Te is used te Convevt TH givem shiny into lowe? - cate letters. Ex vay name > MADHU" : douument. vsvitily (name - (6 Lower ose) 5 I ete’ mad bat. D> bo Lppev lose (0 *- te ig used te Convert It given sing fate epe™ -cose letters. ER Vay names Vmod! 5 douments coviklly [name + boUpper GseO), Nets MADHY > Concak O*> The simply ER vay nami Mr ovumontrs vow le [ ROME concatl" combines A ConCalinsles toss Shings- ” may mel madi’); Ma" Scanned with CamScanner @ chav ALO!- ya Te relies a cludiadew based on given iudaje value - Ex var names" Made” } shame. CheAE (3): I eypim W | > suleste'- a is uted fe embark subshivg tom given shang. Br uge Hoe ceegurne, “index” and “length’s x= vay names" Mad he"; | mame substel2/2)).. ff %otn dh => Subshingdi- 9% qe is used f6 enlrark Substing rom given “ging > Te use hoo arguments, "index" and “end Ee vay nomes “ madha”y name, Substring (2/42 Hog: dhu => index of 0) — TE melon an asx abasad om eer var name = * mad!» name. index o C's!) I Oy > => lostindss of UW De tars a chotatley as am argument and ruliimns ca ok Lasers tH hinge given chennliy + Tm uate value, hte is appsenens a ver name =" my madh! 5 vores Lasttndex of er’) > [ote 3. > Length , Tt nalaems « length oe given Shing. ex var names Madu! j ramen (engi s fae 5 ky mt obsel amis object simply caplions The dale oe tte focal | syst ok That smshant and. sulins the volus . seg Vay curverhdali = New Bolo; TH has delewing metheds 3 behing! Te sutiyns te sting respectiae oh dali, | > gtpa:- Te welans | bo 31, doy of molh = ybboyt- Tp mbes © fo & , Sundog te Salurdoy . Of, gan fo Dec: | = gakMontll 0! ap yetawus | uy digi yaay me > getevllfearO) y- Tr xcGerwt > gltewsOr- Ue welurny © fe 25° > alms Tt warns o fe Sa. > qkseconds OF Tr rehuway 6 te 9- rs SCODING BUGS ©)NOTES GALLERY > SokDalk (1-31) i mol and > Sekday (0-- 6) $a, deli, oy, => Sol Month Lo 11) yeat: => sekpoll yeay (y,m,d) > SdHeuvs (0--22) jadl > seb minutes (0--59) = Sek Seteuds (0+-S%) > Sb Tie Cae stant 2 $5) |S Array Shyer t= | | Array Ga calledion de tims elamenks . 20 | Tevascripl, Arrays axe cyaalid Using a Special Kay od coy dat, hous, minulis $e aud time = ‘ G Vor Array name's mes Array U5 Ex Vay number = mew Array Co) > 5 Scanned with CamScanner she Array obbgect Supports Fdlowing methods | => push. Th is used te msert data into an Seve —____l once Me clea it pushed , ervey SO gets increased - EX! humbevs push (9) 5 > pePO'- This used te xemove Mat elements tom om ANY on eres Ex numbers. popcs) 5 eta elements im AStendig = Sk Ot DW is used & omreng ovdey Ex’ umbawys -SevE OD) | > reuse) 1 Tk Tevenses the elemnentt in an avvey. | | CE: Mumbars » mevert2O5 | cxampl'- Vay @hidenls = new push ('seatha” J; Oe" "Rous", “mokany, ever, | 9, Seetha - | Array (Rovi", “wolan, kites? | sate Sli doukt- saat | tr dewks -pop ("Moan") or” Ravi, ive = ss * Dymows ¢ ATML ktm Tevasen pl-i— > DHTML ig o combination dh HTML, oyastvipt, ess amd BomMLDuMmenk obseuk Medel): Th craolis Some jiveive and aninelid usb ciles+ > Ty is dene aftiv loading MH page aud duwing Te vremrkg POWs’ + > DHTML coda i cifficull te be debugged becouca it is a cate von dewaloped and ch veouigus Techorelat Tht dynamic HTML prowides Valisiation qretess > Dale valictabion s~ Validation & pr cata wague be conraeck dali @> out oh ensuing ab ne the povkeuloy apolicodion, Scanned with CamScanner pala valtaadivy is & PROCESS TAYRERYS NOMEN & Sey vy tte dota Pepired ky te Bowes, is aloud fo enfi a SCODING BUGS ©) NOTES GALLERY _ ODING BUGS NOTES GALLEY [ ete > validatins , esexipk lavguage = “gavosevige > duncion validalt LD t Vey uname, ped, cpusd, emal | uvemis chotuwmont, fams (“vin”). naw wel! ped = dourmant-fams Cebit ) red - value > cprod = dovument-dant Cdamt')« pod. valu’ email = doumentsdéams (fomi’) - email. val ab Canemese” I pod 2°" 1 cpa es 7 tend alert U' ple enley alll aakedls" 4 eta cb Coname-longt 8) cllerttUey name musk be aklentt & cleradkrs" ) i else dll pod. logit < 6) ‘ ui uy: alevt C"patnodd must PS elGast 6 Charadir -y 3 i : else cb Cped I= Cped) : wy. clark (" pasuadds didnt makeh”)) 4 , eble tt v ig pone Succors* y t < lsempt > Thont s fh ol . Scanned with Gamscanner : Zhody > adr > etn > Z/N> atr> a2ltd> alW> ZUA> <> inp type alby> < Lam | body > 2 (nhl > 1 Zim nomes"cemi" > Ztabl aligns" Cenlix’> el > usevname: etd > Zinpul tyeo=laxt* er atd> Passwad + cinpud (Gye =* passwd” name = pod? > conf patsubdd 5 ltd 7 Ltd> E-mail: cid? 2ta> : =" baklon® ‘onelicl’=" valida" naw =" btw volu (=* Subst" [> =" Onan iP ‘eila> iut> itd > Vamail >eimpub| SICODING BUGS &)NOTES GALLERY Scanned with CamScanner Conley pasted Fe Even Handling th gave seviph f- | once ry eveud is guadioltid , Mert & oft Togutrawenk ty code te prowess Meso ever. suds cod | Known as event houdley. | rua allasatng aa. conmngrly vad Event have | > onload i Th invokes aS Lonas o atv usb douument uss loaded. D> onekeK Ut Te Gvoket as toon as Hikenever OY & ) mm page: chen jane etic: > menage O2- Be iwvotay wnewemey dala te ay # Tm WTML. combol (tax Hany, FExloua ate) geks chosged- <> onDHleMtCKOI= ‘Tk Rv let Ushaneuey omy dt eo alewests ove cliciad heotca- ! te TE Wu kel aS oom ah a UY > on Meteo ir Tr tw i. met mouse Potliv ower ay Chmete. +4 all Scanned with CamScanner = aoe TL (s Somat Ma utey pweit Thy © Ls on Subernit OO" TL twotos & Uwe pw ubwik butloy 07 he wrth pogt: onalead 0 > ‘Te invo Kes as Som as a givEM woh 5 } documart is cloted - tha uber aleates > on keyop © t= TE Wvokes ab HM) O41 fe keys usey pos > on key Pron i= Tk Iyvotiel as Sey) ay the Tae Key. as any Taek B data = onRluv 13 2- TE Lrvott as $00 Ans Hae Exarplt = SCODING BUGS NOTES GALLERY [ entwl> | chead> ZANbl> Evert handlings Ww Zhody onload = laleyt ("Examge H gevateneh avo) > cht align =" conkiy "> cyovasesph Evade
chy] > = alovt ( *egudalt)> Once Ever: 7 Onrey Down Event! Atnpul Wgpe=“layl” Value =* press any ey” ontay Pron =' obart (" Fayprow")'>< tinput> | Ontubbw dt Ever! | * Submit: ’serimpul> | aHerm> | ING BUGS CINOTES GALLERY 7 opening ane ond closing a_Windous'— Te cpay a new werden, we Usually susect Ghai, pitcheived gavasenpt unckous. | Te Weng Synlie \s votmdies open ('URL lasivdas manu!) + a Dvelt Heve we Supply ta oh ta pages | D Hidaws memes Ap Spoushies Mn blades nam | And te supports tigpeuuh Sper oh atabulas, Gee | | Scanned with CamS¢anner Exomple GS clsivg watindes Syke | n . 2280, lace” width ~ ‘prel height » pote! socollbavs > Yos ox NO Spud Ldtydous close es, _ S)CODING BUGS ENOTES GALLERY ehoad> ZHHL> whndan aparabions < Hitle> body > <(wpub> © glue = SNe phudowd ) t ee pauteTk (neA10) ; Sun = Sun + br N= pavseTnk (1, io): £ SEC bemp= = stm 3 { dloumeud. varitit “ Amstcong”) 5 tf else L dota et, OL LY NOT); J Scanned with CamScanner ET Wat, % gavaserph ty fine Sivan numba” ig pallendvam BL not ehiwl > Mend > titled Palleadwam Sev pk \awquage =" Gewa Sow pb" > Vor Ny Yemp, sums 0, We pase nb ( windouss prow) CE alie vols" Lemp = ny whll nso) a= porteT ab (4 (0) 5 Sums Sum % lov n= powsdTuk (1 Noy} 4 uk temp = = Suv) \ EICODING BUGS E)NOTES GALLERY ousmenks writiln L* pallen dv’) 3 else ouent. vow bln’ Nor’) } elsew pt > | < Ihead> | Scanned with CamScanner | H vtec a gave sexipt- focfivd He prime numbows uphs Muwabovs « < head > etikle > primo neva bes a(ttle> ‘ | Var on, crm, 5 5 ne pavse Tuk (usindao: prompt C Bali a Value ‘yy: deumouk. Wvitit prime Mumbat axe! )s aicisty teeny tat) t crunk = 0) daticy erly st) t.. ub ug =2 00 \ { cant tty 4 ¥q a =>2) sen >

You might also like