javascript_php_ajax_handwritten_notes, Study notes of Web Application Development

The document introduces the basics of JavaScript, including variables, data types, expressions, functions, and arrays. It provides examples and code snippets to illustrate the concepts. The document also includes a simple calculator and a form validation function as practical applications of JavaScript.

Typology: Study notes

2022/2023

Available from 10/04/2023

praseeda-kallakuri
praseeda-kallakuri 🇮🇳

4 documents

1 / 46

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e

Partial preview of the text

Download javascript_php_ajax_handwritten_notes and more Study notes Web Application Development in PDF only on Docsity!

The Java Saipt cry Leer bepaiately ajler assign thane tag pwoithin the d Ocument= Write (eh Heading 42/h1>') £/saipt > < htimb> Oulput : Heading body tag ovin the head tag: — Nariables Datatypes Stang, Tavaseipt will treab the number as a sbing lee x = 164 “Volvo”; Output. 16 Volvo ke y - “Votvo" 416 ; Output : Volvole ° Evaluates expressions brom Lebl bo right - bot a =1b4 + “Volvo”; — Output : 2ovolvo Ub % ="Volvo'+ Ibu; document -gctEtemendBy Td (demo innes HTML =% 5 Oukpub: Voluo toy,

éIsanpt> vase Output 312 & Output : 19 = vesult; The Operator : Calls the function a f w0) " sorry ig © io function bocelcvus (f) 4 Tetum (514) * (F-3a)5 % “a let value = toleluus(a1) ; lee 3 we ; Ly when this value is ae @ = Value 5 Not given, output : Nan per wT éIsevipt > bs SS eee Oulpub: 25 og ae To check ‘EF az=byarb or ach <\iimL> funckon Vonty3 d (“inputa"). \f (douumant-get Element 844 ("input Ne ee er 4 vali douument- wile (la is greater than ‘5 Clseif (a wbds " document-write (“la ts lesser than b)4 else ¢ ; document write (a is equal to b’) % 3) éIsept> iil eMmput type= 1 Td ="input2" > | Zbutton onclick = Verify > check 2! button> Dimple Columlator C+)-) %)%) chtinl> ctitle > Simple Caleutator 2/Litle> Z ! | cht7 hvray Sum Glowtato2[hir Zp> Enter eamma-separated numbers .

Zinpuk type="text” 1d="thpubtext'> Chutton onchik ="calertatesum()">Caleulate Sumd/button> Zdiv id= Yresult">z/div> Zlbody> Zthtml> SvTeUT: 5 Arsay Sun Calewlation Enter umma-separated numbers 3 [2341s [Gladate Sum Array 1,3 41S Sum 3 ly Cal E fundion vahid ate Foy mL) $ Var firsthame = .q("firstname’)-value , Var lastname =d qU'tastnam’). value, Vor address = dq (“address")- value, 4 email = Cemal") 0; mobile = U'mobile”). «5 girder: U'qinder’) value , Password = U'passtwoid”) + 5 ® finstnameEra0y = — (firstname Evaus"); vale eS. y - lastnamePraoy = (lastnamet7a01 Dj ( Form Vobidaben 3 i addressErany = address E7203 J Using HTML) (35 q | Z © emailErxo% = email Evo!) 5 — TAVA Step be mobile Exo - CmabileEas0s 9} RG: o 2 QenderEsy = (aunder Error’); ‘ “Sa @ PassuypydEavor = (password Ex907) 5 MReset erroy messages wy oe a e OUTPUT: r 5 = Registration Form (Can |... Fiost Name I Pahorm validation XE (fastname ==="") 3 . , | last Name © = “Fist name is Yequived 5 [ Yous last name--- Teluan alse ; 3 Address 1} CLastname ===" ") , [ Msame os eae} 3 § mobile , gender Password 3 "a i Wiumber alee Registration sucessbull" ; qeousn true j 2 Gender : CIscript > : [up sal ot Password gordo chum\> Lowe passwd = pA OC ER F ARRAYS Devlaration oh arrays : <'00CTYPE himt>

#tconst cars - [“saab’, “Volvo”, ‘&mw"y; M4 d-4 (“demo”) inner HTML = cars § t seripit> < const cars=C1, #2 C cars [01 = “Saab”; cors{4J = “Volvo; coys[yJ = “BMW's ; = dq ("demo'”). innerHTML = cats 3 i Const cars = new Array (saab, "Volvo, “emw"); (1a dq Udemo"): mney HtML = cars; i vid-snil Uaccessing Elements in an’ array: Raa 4-4 Udemo"). inner atom = carsto}; Howkput= Saab el pine dg (dumo"). inner me = Cars} Houkput ~ Saab, Volvos BMW ee ae Oe aay ith Set. d-4('demo") Inner HTML = CAYS; — Houtpuks Oped, VoWwoyamws Z)scripe> aaluiibalis: - alo > > peyeeat 5. we — < bowie Array Methods : zp id > demo 4” Zp id= “demo Compr > : ee Const fruits = ["Banana , “Orange , ‘Apple’, Mango |, Let size = fouits. Lonath dg (demo) innernitme =si2e5 floutpuk = 4 MWry7ay to String ; 44 Udemo" )einner tm =hauils toString 19} Noukput = Banana, Orange, Appley Mango "To joint) the Shing : 4-4 (“dumo"- innertitin = fruits:join (" #"); Houtput = Bananat Orange Apple * Mango misting Innes HTML = bouts 5 2 Houkpuk = Mango demo4"): inner Htme = houilss output ~ 8,018 !IPopping and d-4(fumo"'). fruits. pop > dg (% 4g (“demo”): innesurme = fruits 5 - fruits push kiwi"; dq Cdemo4) inner Htme = fruits) Moukput = B, 0, A: kiwi ASHSEO : removes hiss element fruits: shitty j loukpul = Banana 4-4 (demos). inner HTML = }ouits , Moutput = 0;A;M Hunshith c) . adds elements4o the beginning bruits. UnshibtC Lemon”); Houlpue- aq (demo4D inert = tauits,; 111810 81m delete ddete fruitstoy; 4-4C'demoa"). innes HTML = frwilsfod ; Hloutpwt = Undatined: furts Soxb (7 5 d-a(“demod")-innerttme = foutts 5 Mowkp ut - A,Bimo / ép Verse (7 . fousls-reverse U) , | O floutput: 0,m,B, AO bruits (fruits length j=" kiwi’ dsq (“dumot').‘nnes Htme - \ruits, Houtpul = B10) Ay My Kiwi Il Concatl) : Merge aT OUYS const fliris= [“Praseeda‘, "Pranathi"] , const boys = Ray", "Ravi" ; const ab = winls- cencat(boys); d-4 C'demo"D- inner HTML = ab 5 Howeput = Prasecda ,Pranathi, Raj, Ravi const animals = ['Dogs", Nats"); const abe = Ginls: concak (boys ; animals) ; d:q Udemo") «inner Tmt = abe ; loukpuk = gras: boys animals spicing and Slicing Arrays ; Splice : adds new item slice s slices ouk @ Piece Noo} dale fruits. splice (2,0; "Lemon" “Waiwit) : 2 inex “I climant 40 ‘be added A CdemolT-innes mL — bouts; Aran outs, .B) 0? Lemen, Kiwi, Ay m “APH (0, 2,29) » oubpub=a I Slice - enact sye “postion Slice (startin dex, endindex) ov SliceCstast, Lastindex - 4) frutts seu) ruts: slice (ap Starts rom a & and 3130.40)50 goes Hu fas lEunchens tn abject Const person = 2 firstname z STohn’» lastname #''Doe"» ld 2 5566) fullname : functioni)3 Yeturn this-firstname +" "4 this laskName ; 3 (owner of the function) 33 Person - hisstname EVENTS @ ondickO) Output: [Fk Hire | - [Sun Tunas 2 The time 187) =) \Sun Jun 25 2023 Cbody> = 2 raiaeeee| cha>---- c/ha> Cbutton enclick = "this: inner HImL = Datel)'> The Hime is? zlbuttons | ® ondbelick 0. Dowdle cice Zsenipt > function moe Output : 4-9" ht" )-inney HTML =dakal); % Cale Lisevipt > ee < body > - Cbutton ondbuiick @ mi) 5 >Uickz {buttons fh4 id=hi> Hatelhi> 6) OnimouseovetL) & onmouseoUe O : Cs pt> funcdion m0 4 Hite Output © A style herght ="300 Oa-sty le width ='300%s 4 initiod |] 20 ommmawserat Punction mac2 $ 3s ; On: 2305 pnmovseover +} | [pee ‘ ) = “30%, ZIseaipt> havc BQO s PS et SP erres er arent oe TO eee ) Z body > ” ® onload () Mtmb> le 7 na Sonioadie q twit funckon wea [ae Uisplay hha alot" hhhh')) 3 7 img sre =." huight="300" width 2200" . < body donload =“m4n"> ‘ < Ibedus i © one {) hin thre vs an error in Loading - Same above code but seplaw onload with oneror- | © enseleckt) ] Zhimt> eubput : funtion m407 alirt ("should not possidle to select); 3 — oe Name cinpul type-“text” onoelect *m4i"> Password < Inpuk bype= “password” enseleds="m40)> @ onfouus4 onbluro — click onthe gource Zhtmt> é;