0% found this document useful (0 votes)
7 views28 pages

Javascript Handwritten Notes

The document discusses various programming languages, specifically focusing on client-side and server-side scripting languages such as JavaScript and ASP. It covers topics like variables, data types, conditional statements, loops, and functions, providing examples and syntax for better understanding. Additionally, it highlights the differences between JavaScript and Java, along with the benefits of using JavaScript in web browsers.
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)
7 views28 pages

Javascript Handwritten Notes

The document discusses various programming languages, specifically focusing on client-side and server-side scripting languages such as JavaScript and ASP. It covers topics like variables, data types, conditional statements, loops, and functions, providing examples and syntax for better understanding. Additionally, it highlights the differences between JavaScript and Java, along with the benefits of using JavaScript in web browsers.
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
| + serioking Langues | EJ IMMBEHME sme se These. ove. Spevalized preqrarvimiug languages whieh | ore used enhance -fandionalily ond oppssrane ob usnb poges | Tose ave hoo (pas - Chew -side seaping lavguge used or sionple volidectons ab Gent ~ side. = Sevver -Sidd sexiphiug lorguage used f2t dalihate veltcoten Seri phiug languages clienk-sida. Server-Side vBseiet script Javascript ASP sevvel, SP. 2 legs- CREATE BY - ATUL KUMAR (LINKEDIN) Ths is Used 5 imeludet Mme Seet inte html document. Amok: Zscvipl language = none gt seoset > < [script > 2 The Senipling Canguogs cou usted fs mmdifly dacument!s Conlik clyyna mtcalty, > Fovaceript WS @ client-side Sevipting language « Scanned with CamScanner gova Seri pk om hye gua, which is dasigned fe enkane uncktonality cb vsckpogy That ave dowtepad with HTML= Tavasewpt is a clcewt ~ Side tai pling lavigusye. D> Similovties behuan govaterigt one JOS + Ls Goth awe Same Eid oF operalars, Ly Similar cove Shrucbares. Ls comcapts ph obgedks ond matheds ort Sintler, SD Digherences Lehuana serascript avid Java p- Ly gava is am cbyatt -Buenkid when qavaseriet | is am obgetk-basad Sevipkvy lomguayé + Ls gown sasue code Us compiled Htyst ond MAM inlivprakad, vllere Jovaseript Code is nak compled only julticpyotid - otis ty rae obgedt — based programming Layguaye, wt com ude pre-defined objects only The obgect —Sienld paquammiug longuage Suprety ts cveolt naw objets ond te wt te Objet > Benifits oe savaseripl 2— in web brrosert Ly widely Supported L need & Spevtal plage fe | Ly sb Senjasd dow! uy your Sem pts J Lo ab giws The eaty aceats Je document obgett a com 1nost oe Them. — SICODING BUGS ENOTES GALLERY Scanned with CamScanner X Vesta bles t= A voriable is a named locato that usted. to edove any value fal That pareuley progyom + Rales 4 Rowing Tht variable :- pegin with & letter & digit BL Unde wierdee- —> Names musk > spaces ove not allowed in bebucey vaicable Name: SS Names ave Case Somsidive - wow VA aS vertabl Name+ cred by using one Kays > Reserved werd = ALL Vooiabls Can be dat he “Vea. Ef Var ay Nay sums 107 * Datatypes SICODING BUGS EINOTES GALLERY jousconph supers ellewing dotaliypos on Ls Numeric a tie ° Ly strings — Nee an tee £0. | Ly Bealann, vey num Small vt nene “Mah 7 vey ages null; 4 wuld % Qperolacs in Java senpt :- | Ls pvimmelic operalasi- — > Reledional operalovst- + — > Addition <> Less than | - — substraction > > Grade Than | MX > Mulkpi Hou ez lesstion a equel to f= Division de ~ gray thaw ayquel © = “f. a Modulus Ly Logical © Noes Rabally spoulbes :- ga > logical AND > 4s qual © Vy > Logical oR > ty nek eyual te - Scanned with CamScanner © programming Him Tava sexipts + Examplti- The qeollesing enample prey ren disploys Im Nalmol ext « | chhml> | eHHe> Samp . a! 4i-- This ndicales he comment --> dowunent vovitily Cis is my Rest presen"): decuweut «© amitely CY alsal gavo.sonpt')” Tganaglt « Wan gaya sevipt | | < Inno boo © Sommpu gavo Sev pl 7 Pf | Th Ta above encmple, . S esenpt> tag is used to theluding Me Stet ile This ig my ofrsh prgvom abrk yao sever html doument. BS Valen <>", tale ty Une Fo disploy Br be Hee Conmel Text « >“ dement-owiti io” bs Aad Fo display some (axl 0” et ‘ EAD Bol A gin practin te deploy thy sevieh th rma HEA vegio"l se Tk HTML Code - Scanned with CamScanner Examplet- the Jalluang scipt damonshats Ma adelition and substradion cb hus num bert: SHES Sevipt te addition and Subtraction < Htb> Asahi | sent . | j vet My Ma, add, Sub! Ns toy nels; add= Nem, Sub =M-ny dowaments worileln (addition is" Fadd)s cdourments vovitily Ccubbodion ie 4 Subd), Z1Sey pt> Alhaad> oipi- SICODING BUGS ENOTES GALLERY e Th oddilion 2 Sublocltoa ¥ { | Action is as | sublackion 6 S | { Th Te emampl, of can assign tm vosUns aivodtly to vowables, watioa tak Gin! CAM alee provide These volats dynamically | dering sum Hime. tina Number 6 be | TDW do That, qust xeplau Te Code fon F by fellasiny code - Scanned with CamScanner fy = parse Tak Cuvindan « promt C ewliv my volar” 3); wy > post Zak Cusindews » prompt Celis Ma Volua"); uy The eokpuk will be genonated to Window «prompt — Th coutes a small windms [6 be displayed on comsdle - > paseInt - Tt is used fo convert the givom sting iol Talay + Similarly > parserloot - Le is und te convavt @ givan Shing feeding volun nde a Scanned with CamScanner ¥ Conditioval Stelamewts:— Ls & stalemew: = Ls else -i4 ladder :— Sywlex'- 3b (Condition) Saul - Lp Ccondition) i i Statiments* Statiments; t : elta i¢Cconditiw Ly Yrelso stabmewk: t _ Stekiments 5 Syalox- Uf Condition) ? q aise stat i anaes Stolemerds else 4 t staltmonks » I Example ~ spy fellows amample vas mantmum ve Thyac Num ~ ears : SICODING BUGS ENOTES GALLERY ; ELit> manimum o& ZB numbers na = parseTak (usindous: prompt (elev wi veld), Ng = poyseTat(cuivdrs: proMPEL™ Enliw vig vole ))> ok (n> ML ARM OME dousmant: willy mogienum is ands else CMD My FH MPMI | dauimenk, wibly Umoximun iy? +7 | 3 else. NE aly douamtuks woitaly {Y marcia EAI? Scanned with CamScanner elseniet> - 2 body > < [body > ethhml> api Scanned with CamScanner x Looping Stale mont — Lo while staléments— aegin | | hil Ceondition) | £ Staliments; | 4 Ly do-whik Stalement :— sywlox + do { “Staliwtends F while (condehion Ls 4a statiwenk syntax + 4B Cinificl vation; conditions inevoment/decrement) L Basin Stehwwanks 5 an a False | Edt | | Tut. L 1 [Eacrtratell pecan * Branching Shliment :- L sutteh Caseim — Sywlie- Sei tel ( Om pression) L case 11 stolimenks > brat; cose 27 Stolaments; ereute; defeath ! Sabrent; & Scanned with CamScanner vi bor. Exampl t-te tind Jordrof a given Number. | ecwtmt> | | ZAM (9 » Jorbdiod <1 blb> | soe | | << sexipk — lenguoge = “Joues wp > iy ant ny ade =U | | Ne parseTnk Lusindane « prompl C evley a vumber]): \ | . 43 \ | ab( nero) | | * soastanets writ Cracked is "1 f else aliens (eens trad a foots adh #15 wy . ansars cob Ugerkiaa) i tO)? 1 | 4 | 2 WSeviph > | | Z body> |

<é/htwl> Ey plore user pen Eydiv o number Scanned with CamScanner | % Functions \ A function 15 a self- condained block ob Slate wed Trak pertim a peotaday tase. | Bosically ,functoms oe tue types, They ore > pradafined furcions > serv defined nchous Ly pre defined eunctione s— These ave alse called as global -undckions, becouse They cam be calli and used ty any part ob a program. > isFink Os Kwually The about. fonction fates tha numeric Velus os am adygument and mebaeas true owky iF he ghusm cogument results a ferrite numodie else tf %eharns false Bxampll’-—jspinike (Sho)! > TE rekins false > isnancye © Te seins tut slates only ob ta on guimente is nko number, le i nelivas a false getou. Exampl’ sna (0) > Th relies true, > pouedaho Te acept, Shing as argument and Comunts | WE ify Sguivaleant nunete, Example. panseTak (iow; 3 Tk converts (o 1@02 — porsaploatty: Tr caceapts String as argue” and comme dts ke Th equivalyak flocking yalas > i Bxompl:- parce pleak (1); 3 2-60 | > eal , ub, it is aed | Te lees a Sting as an oyume Te qe evaliting The Shing . Scanned with CamScanner Framplt~ Eyal (2%8) —) Th melins &. Ls user defined —fanctions to —_ shese Jundiont ane didfivid by user byw predated tryurdred “ancien”, Cork rh these fundions cam have FAaing => Junction name > Lise of porame lens > ust de Salimonts > Relirn ype Sywlax funition Jundion — erat { parawylirs) ra Stalivarntsy Zhtml> ZATL> Example fai qfeurctions Z/t a? scrip language =‘ gavaser et” > Vor a a= parseTuk (usindeu prompt L" exlie & num") doumewks writin CO’ spusne xf gtuen he gs” sr sqrt co) oume wh sti | a8 it e + wl s tvam ne he e es cubeta); Junction syusu CK) Scanned with CamScanner t | ven ©) | Ct KKEK kK roku ©) 4 Ziseet> 2 theod > 2lhtwl> | function cube CK) | | — be Obgects in ova, soxipk t= Uses check -dueubed - conlapts : wohid obseck is noting oq olhey autres - ouejos Tn Tm oval which | can, depart WW Tn, Tava severe obsecks | deka and cundiont+ once, The gave Some gehs Space i sy sevud fai “Gack olbgecks axe. Stoved - where. is denckiont The Tovaseripk Suprortt Doumenk obgeck 2° Te wid dowment mejor to the silt dtsqlasys Ma, broustey winds | Tr had fellewivy methods | > Wak! Writely (0- Te w Ud 5 display Me fet on IA Bxamply- a dowsmenk. vont (“aot I, Ai tad Scanned with CamScanner Ty todays wdtld clmask all pragramming Long veges conteurt Vnleing enoulid, o Sparel moby uk an ently, dota. ond page which chuemonts A &f usindns. closeo + al te process Mr elements th frm, Exempt! — doumantacdas (Fam~- namely > Unks Ot~ a is used to Llebpage « Exon: clourmerk. Enks 00> hold the number ob Lines th => closecr'- Te u used [6 step quscrenk proais on Me doument. Exava — dourmouk. clese Cd 5 Ly Window hye 1 / “Te Mag a ttle bar, message , defaull (eon, writ one BL mae Command buflens Te Supports felleustuy matiinds re hed PD OPN" Tr is ated G open a new oindaa TF 4u20 Sgumonts | \Rese oe > URL decanted => Name wit fd ee — Windaus ope (Tua , “name’) F SEO Tie used te cerall” Ce edtedeus ensily - Ue Mas shoo cyumen , thote tL > x- codivall. y - Cobtdi nolh.. EX Windmas Serell (100, 185) + D> promt ays ua be Se ercloysl ithe ie user by dissayty Seat voinden- EX Windms. prompt ("emir a valu") * 2 cote oF te uted te Clnge Mm cuvent ade" Scanned with CamSeanner | b> Math obyeck i ™ che math okgetl have Ta ditternk pes cb matkals. those aut uted To penvdiim several MoThemedio) calastalins. | Te has Helmaing sydax, Math « method (numeric velists) | sre owing oe FHopuoubly used mathematical melheds . 3 mmMur TE acsplays Ma minimum a two numeric valuas. ex: doumanks GAL (Mathemin (195I)2 Moje © D> max) TE dicplays the moni mum ERY doumeut. ene c Mat: max (1orS)); Mee 10 tuo numbers > abscuin- Tr meting Me absolali vols th % Ex: dowment- wil (Mary. abs cus); Heer 43 SS c&lOvyi- TE vebiens The nesmesl- iwligey nok (asy (han x. Ce gouamenk « wile (Mame CH LCS-£)); MoH & dowment« candle Cate Cal (S09, HM ove 6 => romd(n)i- qe Tekurns ta neorest i ’ EX gouments writ (mata. row (s-6)5 Hepe2& document. on & (maths yound (f+ 095 Leyes > Moov) — Ak satinens wee nesstest ieleger nek areeley Than. EX" douumant. wraitt (math floor (5-8) 5 Nope doumenk- com (Matfer CSD); I eres” PEO Te sutisns pau ob one velit : Evy doussnenl. unite ( memm pases) Mop: & ~ Scanned with CamScanner | PsgTtOr Tp veliwns Thu guert crook ok given Mumber. | Ex: doumenb- citi (math seb la2 Me 3 sive, Valus> > sintr'~ ge nolaens tigenome dae dowmert. usw le ( Math aSinlQo))? I le= I Qusns dnigowemebic CS value. AG Cuath. Cos (oI) wero. | tan volute - a > cos Ip rw gx! document + | > tam yt Tb seluns tvigevomedte Ex douwment. vont Cath lem (usd), W%p 3 > bog! TE relivns leg odtimnic equally vole ERS dauumont « canbe (Mah » log 62-91), I Pie Vo Ly sting obgeet i> In geno Kew enclcod under deb. quelt. The Minsing ave frequently used hing motteds | ms sting reader la Soves ok chorale > lp Lowey ase Ot Te is used te Convevt THe givem shiny into lower - cate letters. Ex vay newme > MADHU" : douument. vovitily (nome - (6 Lower ose) 5 II ete’ mad bae. D> bo Uppev lose (0 de ig used te Convert Ita given sing fate epe™ -cose letters. ER Vay names Vmod! 5 douments cavity [name + boUpper GseO), Nei MADHY > Concak O*> Te simply ER vay nats Mr owumontrs wow te [ ROME concot(" combines MA ConCalinsles tose Stings: ” may mel madi’); Ma" Scanned with CamScanner @ chav ALO!- yao Te relies a cludiadew pasted on given iudaje value - Ex var names" Made” } shame. ChecAE LS): If eypim W | > Ssuleste'- a is usted fe embark substing tom given Shing. Br ge Hoe ecegumne, “index” and “langth’s ex~ vay names" Mad he") | mame substel2/2)5.. ff join dh => SubshingOi- 5 qe is used t6 entrark Substing yom given “ging > Te use hee argument, "index" and “ond Ee vay names “ madha”y name, Substring (2/42 Hog: dhu => index of) — TE relond an asx abasad om eer var name = * Madhu!» name. index 0 C's!) I Opp > => lostindss of > De tars a chotatley as am argument and rulims ca ok laste Hime tH hinge given chenliy + te vugnaite value alitelr = 16 appaanens a ver name =" my mad! vomes tosttndex of (ler!) > [ote 3. > Length , Tt alaems « length oe given Shing. exe var names Madlul! j rameters > Maes 5 ky mt obsel amis object simply caplions The dale oe tte focal | syst ok That smshant and. suis the volus . esa Vay curverhdali = New Bolo; TH has delewing metheds 3 teint Te sutiyns te sting respecte oh dali, | > gtpa:- Te velarns | bo 31, doy of molh 2 ybboyt- Tp mbes © fo & , Sundog te Salurdey . of W, gan fo Dec: | = gakMontll 0! ap yetavus uy digi yaay Me > geteullfearO y- Tr acer > geltewsOr- Ue selurny © fe 25> > alms Tt wlavns 0 fe Sa. > qkseconds OF Tr rehuwy 6 te 9- rs SCODING BUGS E)NOTES GALLERY > Sok Dolk (1--31) i mot I and @ isdibayy Co) $a, deli, ou, => Sol Month Lo 11) yeay: = sekpoll yay (y,m,d) D> SdHeuvs (0--22) jadi > Seb minal (0--59) = Sek Seteuds (0+-S%) > Sb Tie Cae stant $5) |S brrvay skgetl t= | Array UG a calledion de tims elamenks . 20 | Tevascript, Arrays axe cyzalid Using o Special Kay od coy dat, hows, minulis $e aud time = ‘ i Vor Array mame: mes ANray Uy Ex Vay number = mew Array Co) > 5 Scanned with CamScanner she Array obbgect Supports Fdlowing methods | => pushOr- Th is used to msevt data into an Sev —___l once Me dlala it pushed , ervey SO gets increased - EX! numbevs push (9) 5 > pePO'- This used te remove Mat elements tom om ANY a eves Ex numbers. popcs) 5 eo Wa elements im AStendig = Sok Oe DW ig used & oreng ovdey Ex’ umbaws -SevE OD) | > reuse) 1 Th meverses the elements in an avvey. | | CE: numbers » neverteO5 | Exampl- Vay hidenls = New push (‘seatha” J Oe" "Rous", “mohany, "ever, | 9, seetha - | Array (Ravi, “wolan, kites? | sat Sia dol. saat | rdewks -pop ("Moan") or” Ravi, Kive = ss * Dymows ¢ ATML ktm Tevasen pl-i— > DHTML is @ combination dh HTML, oyasevipt, ess amd BOM LDumenk obseuk Model): Th craolis Some jivessive and aninelid usb ciles+ > Ty is dene aftiv loading MH page aud duwing Te vrenrkg Pros’ + > DHTML coda i cifficull te be debugged becouca it is a cated ton devaloped and ch veouigu! Techorelat Tht dynamic HTML prowides Jaliciation grotess > Dale valictohion s- Validation & pr cafe wague bo tonreck aalie @> out oh ensuing ab Smt the povkeslor applicodion, Scanned with CamScanner pela valiaadiy is & PTOGSS TAYRERYS SO ENB Sey vy tte dota Pepired ky te Byowieats, is aloud fo enti ee SCODING BUGS &)NOTES GALLERY _ ODING BUGS NOTES GALLEY [ et > validatins , esexipk lavguage = “gavosevige > dundion validalt 0) t Vey uname, ped, cpusd, emal | uvemes chotumont, fams (vin). naw wel! ped = dourmawt-faims Cebit ) red - value > cprod = dovument-dant Cdamt') - ped. valu’ email = doumentsdgams (fami’) « email. val ab Canemese” I pod 2°" 1 cpa es 7 (endl alevt U' ple enter alll able"); 4 ata cb Conamn-longt 8) cllertt "Cer name mush be aklentt & cleradkrs" ) fl else Girl pod. loath < 6) ‘ ne uy? alevt C"patnodd must PS elGast 6 chearadir -y 3 i : else cb Cped I= Cped) : wy. clark (" pawuads didnt make”) 4 _ elle ft v ig pone Succors* y t < tempt > Thon s fh ol “ Scanned with Gamscanner : Zhody > adr > atn> Z)N> Ztr> a2ltd> a> ZUA> <> inp type alby> < Lam 4 | body > 2 (Wm > 1 Zim nomes"cemi" > Ztabl aligns" Cenlix’> el > usevname: etd > Zinpul tyeo= lax t" fama atd> Passwad + cinpud (Gye =* passwd” noms = pod? > contr patsubdd 5 E-mail: 2ltd? eta> : =" baklon® ‘onelicl’=" valida." naw "btw Volt =" Submit" [> =" Onan iP eila> iut> Zita > Vawmail >einpub| SICODING BUGS E)NOTES GALLERY Scanned with CamScanner Conley pasted Fe Even Handling th gave seriph f- | once ry event is guadioltid , ext & off Togutrawenk te code te protests MMete evewt. suds cod i | Known as event houdley. | sia allasitng axa. tovngrly vad Event have | > onload i Th imvekes aS Lonas & atv vb douument vos loaded. D> one Ut Te wvoket as toon as Hikenever OY & ) mm page: choos jane etiend: > menawy O2- De iwvotay wneweney dala te ay # Tm HTML. combol (taxon, Heelan ate) geks chosged- <> onDHleMtCKOI= ‘Tk Bro et Uohaneuey omy dete ef alewmests axe cliciad hotca- ! te TE Wve kel eS fom ak a UY > onMeutemome ir Tr tw . met mouse Potliv ower ay Chnmte. $4 all Scanned with CamScanner —s aoe TL [s Somat Ma utey pweit Thy © Ls on Suberait OF TL twokos & Uwe pw ubwik butloy 09 Mme wrth pagt: onload 0 > ‘TE invo Kes as Som as a givEM woh 5 i documart is closed - tha uber raleates > on keyop © i TE Wvokes ab 0M) OF) fe keys usey pos > on key Pen i= Tk Iyvotiel as Soy ay the Te Key. as any Tek B data = onRluv $3 z= TE Lvot ts $00 Ans Haar Example = SICODING BUGS S)NOTES GALLERY | entwl> | ZANb> Evert handlings Ww Zhody ontoad = laleyt ("Example 4 gevateneh avon’) > cht align =“ conliy "> cyovasesph Evardt
= alovt ( “eubeat!)'> Onciek Ever: 7 Onray Down Event! Ainpul Wgpe=“Layl” Nolus =* press any ny” onttay Pron =' alert (" Fay prow’ )'>< tinput> | Onstubbwdt Ever! | * Submit: ’sepimpul> | aHerm> | ING BUGS ENOTES GALLERY opening ane ond closing a_Windous'— Te cpay a new wrdew, we Usually suse Ghai, pitckdived gavasenpt unckous. | The Weng Synlie \s wotmdis open ('URY lisivdas manu!) + aa DueRLT Heve we Suppby ta oh ta pages | D Hidows memes Ap Spouses Mn lindas nam | And te Suppers tigpeuuh Sper he attabulas, Gee | | Scanned with CamS¢anner Exomple- G clacivg petindes Syke | ‘6 . 2280, lace” niidth ~ ‘peel height » pote! socollbavs + Yos ox NO Spud Ldrydous close es, _ C)CODING BUGS ENOTES GALLERY ehoad> ZHHL> whndan aparabions < Hitle> <(mpub> © yale = SNe phudowd Vow Ny teomp, sums o, We pase nb ( windauss prow) CE alie value" Lemp = ny whll Hs) a= porteT ab (4 to) 5 Sums Sum % lov n= povsaTuk (1 Noy} 4 uk temp = = Suv) L EICODING BUGS E)NOTES GALLERY dousmenks writiln L* pallen dye’) 3 ose Aourent. caw bla’ Nor’) 5 } elsen pt > | < Ihead> | Scanned with CamScanner | H vtec a gave sexipt- fo-fivd He prime numbers uphs Muwabovs « < head > etikle > primo neva bes a(ttle> ‘ | var on, crm, 5 5 ne pavse Tuk (usindao: prompt C Bali a Value ‘yy: deumauk. Wviti( prime Mumbat axe! )s Saicisty tesny tet) t trunk = 0) daticy derly st) t.. ub Ung =2 09 \ { cant tty 4 ¥y a =>2) sen >

You might also like