Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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

Partial preview of the text

Download javascript_php_ajax_handwritten_notes and more Study notes Web Application Development in PDF only on Docsity! <html> <head > The <scniptr<l script? can be <litlle> Java Saipt</title > iy eee sepaiately ajler <soipttype “Lext /javasertpe!> aicstqenthenis tag pwoithin the d OcuMent= Write (CZ ha Heading 42/h1>') Z/saipt > <lhead > <body> <lbody> <lhimb> Ouput : Heading body tag ovin the head tag: — Nariables % Datatypes Stang, Tavaseipt will treab the number as a sbing lee x = 164 "Volvo"; Outputs 16 Volvo kee y - “Votvo’ +16 Output : Volvole ° Evaluates expressions hrom Lebl bo night - bot a =the b+ “Volvo”; — Output : 20volvo <scnpt > Ub % ="Volvo'+ 16+; document act Etemend-By Td ("demo inner HTML =% 5 <lsenpt> <body> Oukpub: Voluo toy <P id= "domo'>z/p> </body> * bypeor + we qeb the type ob thw Variable. Eq: typeof o , Lypeof a1; Outpub: Number Eypent 3-14, Yypeof (3) ; bypeof (344); ¢ \lhen adding a number qa ; | FUNCTIONS ; Funchign vekwan : OZ body > 0 ep: id= demo’ ></p> 0 Zsaipt > scapt7 ‘ 3): 4 Ay auras my Funchion (pt, p23 Wb x anes aee de ob, Tekurn pstpr sy document: (re ae f = let result — my Function (413); function my FanckionCar by @) document: actt lementById ( "demo")+inney HTML aetum a%b; 4 = vesult; LI script > élsaipt > Zlbody> <Ibody > Output 112 <f Output : 1g Tk o Operator ; f on sorry! g e 0) <Sunipt> ont function boCeloiss (f) 4 ; tetum (5/4) * (F-3a)5 % : let value = toleluus(a1) ; ieee. 4 wae : Ly when this value is @ = Value 5 NOt given, output : Nan i eal élseipt > - ae </body> eee Oulpub: 25 ulseif (operatos == "x" )3 resull =num4 * num2 3 % else 3 Fesult = num4/num2 5 % 3 dq ('result")-innevHtme =“Resutts ” 4 aesult 5 3 </script> clhead> 2 body > ehA> Simple Calowator élha> Number: Zinput type ="number” fd =“numa"><b7> Number 2 = zinput type = “number” id =“num2"> 2ba> Operaloy : zcclect id = “operatov’> Zoption > + 2/option> * 7 </seleck>Lba> Zbutton ondick ="caleulake OS caleulake <[buttons 4div id= “yeoult”>cldiv> <Ibody > </htmbt> Output : Number 4: [4 eee he) Ghee [mamma * Calowtate | y ii ——— ence ee oo = il Lt wnte the 35 code to valdat the FQ: reat. the pelo pose using HIML WH d Input en clicking the suemit button as follows r U bretds whether it 4 None ob the inpwl fields are empty heck all | 's nessaae “Field 1 5 empty oy not 9 Ih ik ts émpty display alas méssag : = Phy! sl : b- Text im the all Held must be more than 9 character ngth ‘bi “Less Length’ less than s character, display alert message “'e 4 “NI j C- Phone bield must be number tb not display alert message Ot Vays x Submitted”. 4-Vk all validations aye passed alist a message OT a 2\Doctyre htmt > <htmi> éheads ebitle> Form validation |titles <cnipt > function Validate fnmog Var name =d-gt"name").value ; "oral =d-g (“email’).value; phone =dog (phone") value ; Tf (name ===") email ---" “ alert (“Feld ic empty") ; Teturn False a if (name ung the 5 Nl ematl.ken 25 I) phone-ten ¢ 5s alert (“Less length’); Aetuan false ; Zz Mf UisnlaN (phone))¢ alert (“Not Valid"), Icturn false ; 3 alest (“Form Submitted"); qetuon tue ; 2 </scvipt > Z/head> Z > cht form validation 2) h4> p u, <form onsubmil = “retuan validate Form() '> Nl phone ==2"")5 Llobet for = “name *S Name :€/Labely <input type = "kext" id “narre” names £b9><b7> < label fo7 = "email> Email :</tabely <input type =“email” id="emailY name =“email">chrrciny ¢label for ="phone“S Phone - ¢/Labely <inpub kype= "text! id ="phone” name=ip Lb ><b7> : input type="submit” Vale = “Sui Zlform> ‘ <1) body> zthtml> = —_ Eq: Take inputs boom Display the array <'pocty pe html > zhtml> chead> — l he textbox (| leat Uwm a% an array. and tind the sum of numbers \n the ara étitle 7 Aay Sum Calawlahion clipe Zscmpt > function calewate Sum 3 Var inpublext= 4-4 (StnputText)- value 5 var numbers = inpurText split ("5 Vay sum =0 5 for (var i =05 jAnumbers:tength ; H4H)9 Var num = parsefloat (aumbersti J); dng (*result"):inner HTML = “parays” + numbers;oa C4 "I+" bs > </script> <head> Zbody > Sum +=num) % Sum: "+ sum; 3 cht7Av1ay Sum, Guoulatore|hi> Zp> Enter eamma~separated numbers . <p> <inpub type="Text” Yd =" inputText'> Chutton onchik ="calentatesum()'>Caloulate Sumd/button> Zaiv id= Yresult">z/div> Zlbody> Zthtmis OUTPUT: Araoy Sun Calewlation Enter umma-separated numbers 3 [213,405 [Gladate Sum Array 2,3 41S Sum 3 ly 3 der Sk aT ee F ARRAYS Declaration oh arrays : <'00CTYPE himt> <html> <body> <P Id=“demo's cj p> <Saipt > #tconst cars - [“saab’, “Volvo”, ‘&mw"y M4 d-4 (“demo”) inner HTML = cars 5 t script > < const cars=C1, 2 C cars [0] = “Saab”; cors{4J = “Volvo; coys[yJ = “BMW's ; = dq ("demo'”). innerHTML = cars 3 F Const cars = new Arey (saab, "Volvo, "Bmw"; (13 dq Udemo"): innevHtML = cars; eo vid-snial Uaccessing Elements in an’ array: Rael 4-4 Udemo"). inner ATM = carsto}; Howtput= Saab el pine dg (dumo"). inner me = Cars j Houkput > Saab, Volvos BMW ae OE aay cits cat d-4('demo") Inner HTML = CAYS; [outputs Oped, YoWwoyamws Z)scripe> aaluiilalis. am Clbod\> > peeeat 5. we </html> — < howe Array Methods : zp id > demo 4” Zp id= “demo Csumpr > : ee Const ruts = ["Banana , “Orange J ‘Apple’, Mango |, Let size = fouits. Lonath; 44 (demo): inneritme =Si2e5 [loutpuk = WryTay to String ; 44 Udemo" einer ttm =hauils. toString (9; oukput = Banana, Orange, Appley Mango No joint) the Shing ; 4-4 (“dumo")- innertitn = fruits:join (" #"); Houtput = Bananat Orange Apple * Mango misting Innes HTML = bouts 5 2 Houkpuk = Mango demo4"): inner Htme = houilss output ~ B,0.8 !IPopping and d-4¢fumo''). fruits. pop (> dg ( dg (“demo”): innesurme < fruits; - fruits push kiwi"; dq Cdemo4) inner Heme = fruits) Moukput = B, 0, A kiwi ASHSEO : removes hiss element fruits: shittu j JJoukpul = Banana 4-4 (demos). inner HTML = }ouits , Moutput =0;A;M Hunshity c) < adds elements4o the beginning bruits. UnshibtC Lemon”); Houlpue- aq (demo4)-tnnestm = tauits, 111810 Aim MHdelobe ddete fruitstoy; d-4C'demoa"). innes HTML = fruilsfod ; Hloutpwt = Undatined: furts Soxb (7 5 d-a(“demod")- inner tme = foutts 5 Howkp ut - A, Bimo / éo Verse (7 e frusls-reverse U) , | © floutput: 0,m,B, AA bruits [fruits length j=" kiwi’, dq (“demot').‘nnes Htme - \ruits, Moutput = B10) Ay My Kiwi II Concatl) : Merge arrays 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 = girs: boys ,animals Ispuicing and Slicing Arrays ; Splice adds new item slice : slices ouk a Piece Noo} dale fruits. splice (2,0 "Lemon" “Waiwit) « 2 inex “clmant 40 ‘be added Ag CdemolT-innes mL — bouts) Ayan outs, .B)0? Lemen, Kiwi, Ay m “APH (0,129) » oubpub=a Slice - enact see “postion slice (startin dex , endindex) or SliceCstast, Lastindex - 4) frutts see C 14) fruits: slice (ap Starts rom a & 2nd 3130.40)50 goes Hu As ty chtmis i <Vead> le <Ihead> <body> | To Toko fha> Big Cbes2/hi> Zdiv ig-t | aera <soipts oe a Const cities - 3“ Newyork”, “Tokyo's ‘India", “Berlin” } | | fundion det (arg) § 3 kt item =" "; f for Cut i=0 ' 4 arg-length} it+)3 them 4 = Zs} Jang TiI4 ltr; 3 Teun item ; & dg (“Shela”) -Innetme Zol> q get (cities) Zlol> ee — </seipes <body > <lhtml> OBJECTS - <p id ="demo'> ¢/p> <script> “create an Object Const Person = § firstname ; “John, fostname + “Doe', age 50; eyecolor : “blue'"§ ; [2 Indio "Sheela"> ¢ Jdiy > a8 ! . Wey u rs old: dg (“demo”). innevHTmL = Petson- bisstname + No" Pesson-age + yea Mecessing an Object oR) Person hinstname' J floukpuk= John i 90 years old- ii eee ‘nt ni 6 a a bhyle Color = “blu”; % e/senpt 7 cbody 7 Name input type tect” onbtur = “mil thisy'> Jat name <input © onfouuds = "ma (his) > body > <thtml? @ keydownd & kay Wp 0) i y changes fo een funchion M(x) ¢ 54: eet Meter alest (a-valueds % €lscrpt > onbnydoun) The wren presses 0 i </head> Onkay PIES: : <body> Oniatup() : Wt veleases a key. chi id=hip Hello 2) hi> <input type= text” onbugup = mi Uthis)> Zu ee mleydown - alert this value)? ie okey press = ae eae </body> <}neml> @ onsubmit (> chtmlL> <script > fununon chick) = Ola C"submitted"); 4 </script> (REGULAR TxPRESSIONS © Counting the vowels in a sting éhtmL> @ <head> @) <Suipt> Sunch on count Vowels (sta) ¥ Outpuk : o,e Const een = !Tacioud4i , 5 const_matehes = sky.match Lreqex } document: writetn Lmatches 4"Zb7")5 Yelurn matches 2 matches. Lingth Oy 3 ‘ document: waiteln (count Vowels ("Woride ys ® Loipt> ® <head> © < body > lbedy> ® Llhime> @ Develop a Ts program thot extracts alll the phone numbers brom given Vext using egulan expressions. :193-Ysb-49.49 M4 Teqular oxps rl 0} ® © const st = “Contact us at '23-USt-1840 07 97. const ‘eq ex = /\di34-\d 234 _\d 543 gi const matches - st«makches(y qe 5 douument: wsritetn (matches +4b4 >" y PSU-33I0 for assistane's BOOS Output: 123-Ust- 1840) 457-bst- gag Oo | 8 | 3 @Aunchon beste § Ou @ Var 1= dowament-4 ('in)-value ; (aaa [submit] @ Var 4 = thails YE WbestQxn) 2 document: writetn Lyes") 5 3 Use 4 dog Cla": style-visibikty =" Visible; %3 6 © Chody 7 <input Dype = text id =in> @ tabu td =a style =“color: Ted suisibility -hiddens yinvalid User 2} label ® Zbutten bype = button” puke =testl) 5 > Submit 2) button > Z| body> Zlhtmlo © @@s VaA count = 0; oO g Oukput : Var matches = A- moteh uy); ae eubmie douxment «uri teln Cmakuhes); 1 Umabehes ) % count = matches: lengths douament - Writeln( count); 3 else 3 d-ql la"). style. visibility =“hidden's 43 © 8 Chody > <inpud type = “text” id Sin > @ élbody> </htmiy HTML Document <html> <head> <blles My titlec/titte > <lheads <body > <hi> heading <thi> <div Vd = “divas <P> p Tag 4 </p> <ldivs <div id =“dive"s ~P>p Tag 2 </p> <ldv> </body> <(himbs —— <éhtmt> < head ><Ihead> Dowument [ete] my tile Lit4 - bextcontent = “Doms document: head: appendchild (tits), . body cs Ztseript> <Soript > 4lheads Const body E document bid ; <lhtmls WO div = d. create Element ("div") 5 Vox diva = document createtlement (sdiva')- div bextcontent = “Hat Welcome; div: innevHtm = “<sbong >Hal welcome élshong >” div ‘Inney HTML = “Hello” div. seb Atbibute C'class!, body: append (div); body append (div4); i “ddd; yn const tag = document: query selector diy"), lt pa - douxment. creakeElement Cp); pl.textcontent = “Fiast Paragraph’ toy. append tps); it = document: ttle 5 , Ce douument- create Element (SHH. —_ —> zhtml> éhead > <I heads <body > édtv class =“Content'>2/ divs esaipt> Het a reberene Us Ue content div const conkenl = document quury Selector ("content"); Moeale the brast_ paragraph Lat pt - document- creabeElement Lp") ; pi textContent = “Fost Paragraph’, Noeate the second Paragraph WE pa = dowsment -crecle Element (“P'); pa-bextContent = “second Paragraph’; [Nppend paragraphs Jo the content div content - append Child ps); content-appendchild(p2); pi-sctAttaibule Ceclass’, “paral; p4 vemovebbiaibute (class); <benpt > 2) body> <html> Accessing biel value bby document : <script type =“textl fauascaipt’> Fundion mint volueirg Var name = docrment : form4 name. value 5 ales ECWelume!"4 mame); iy <Iscript > <form name = “form \"> Enter Name : cinput type = “text” name -‘name’ > “inpuk type = “buttan” onclick="paint valuett Value =“print name/> <Iform > Output : Enter name (pouil [eine nan| an att wit display Ws page says Klelcome praseeda im chimt> “head > Z <scaipt function validate ) 3 =e Vor username dy (user aa Vax password dq (“password ): valute ; \€ Cusername - Bal password = == ja alist ("field is empty’) 5 yetum false } else 3 Tetum tue 5 3 2 < Isevipt > <lheads c body > yo ; date (5 > <borm action ="\mess-htmt" onsubmit =“retum Validate); Zinput type text” id Duser’> Ci “= “password' id =‘pwd "> Zbutton type =Submit” 5 legister clbutton S <thodyy > <lhimts XMLHtPRequest Properties ZhimL> <style> table » th, td bordes :4p2 soud black ; boxdes- Collapse : collapse 5 -éIstyle> <body > <n2> The XMUNLLpRequest, Object élho> < button type =“ button’ Ondiick = bi><br> =“Looddoet7"s Eet my cd Meckion </button> <table id="demo'>z/table> éScripl> document: getFlementBy 74 (“dats') innes WML BZ JsenObk\ name +°2Z/is? + “ ) SL ek county + c/K> » document: getElement Bytd C'demo')- inner HTML = this Tesponselext 3% 5 XHEtp. epen(* GET" “data: json true), xX HHP send cd 5 4 élsaipt> i <lbeay> <Thimts data for file $name’: “Brett” chtmts <body> <h4> the XMLHeepRequest Object c/hi> Zha> Relrieve data boom xm bile Z/m5 <P ><b> ctor 2p > <Span id “Al ">< /span >elp> €P><b> Status text: 2/b> <Span id ="Aa>zlspan>d|p> Response: ! 1 coun trys Australie.”4 Chubten endick <* load Doc's Get xm data <I buttons : <e) pt > bunction Loadboct? 4 Vor xHttp = new xm Xp Request) x Heh ormeady State Changa = bunctiony 3 ib (this-readystate ==4 4S this-status = =200)37 document get Element By Td(aq” AAnnerTML = this states 5 fA") = Wis. statustextos £43") zou 38; “Http open (“GET", "note -xmt/ tue) § xHttEp- send 05 3 hoaipts </body> </html> y Moke xml code <2 xml version =") oes Zbookstose > Qeboors <bitle >Fvenday Ttoktan ZItitle > Zauthors Giada be Laurens Zlauthor > <YCaT> 9005 <lyears> <p >20:00¢/ poie> <thooks 0-0 <} book store > The AMLHHPReq nest Object Retrieve data bron xmt tile | Status 200 Stakustext sok Response ¢ (Bookstore data Canbe seen’) ket Xm date] PHP —AJAX- xmL; Selection hist for studentsxml bile : Ajar-rmt. php hile code ; <1 D0CTYPE htmL> Zhtmt> Zhead> ite > eltitle> Zthead> <body > : Csevipk type = “text] Javaseript s fundion showstulst1)5 2 if Ustrs=e" "73 e stu = (fy -achild nodes), d FC'stu_ details") .innectetme CY : for i= 0, dreqgu “a ungth; Jit)? 4 IE (4st ikem (4; ~9 node ype = = 4.92 ee echo (%<b>" dsiu-> (em (41) -ynodenarte | “el >") YE Cuuindow. MLL Re Nest) eee echo (4 5\u bem) -9 ChiuNodes 3 XML Http = New XUILHUtp Reque 1953 temo) nodeValuw) 5 thse echol“eb7>") 5% 75 XML Hitp = new AeHWEOL ect Micaso¥t-emL Hp Zlbsdy > ch himbs XMLHUp enreadystatechang ¢ = funchiono3 » Chis. ready Stale =y Us this» status ==200)7 document: get ElemeatB ytd ( “stu-delails )- thnertme = Anis aesponsetext 3 5 *MUHLEp-open(“GET, “Get —jax-xm (data php 24g ="4St7, tyueds XMILHHDP sendc): Bp O53 @® Students amb fle code + <ilsmipts <head> Zlbody > <STUPENTS> <Stu> Zhoms © <NAME > Baoc/NAME> < : < COE HE>VIT C/ > Select Student : CEMAILS Pac@gmaivcome/ > <Select Name =“students! dass =" caas-town” Sporn met tote a iW © © <fctuwents > enchange ="SHowstu Uhis.value)'s ; Hub —ajax-xmt-daka php : CePKOM Value 8 6 Student ; clopttms APOLTYPE imk> < ont PHP_AJAX & XML >" Rad’ > Rao <loptions lle St et ar Mpa P body > = Ral'> Raj cloptions <2pno Ws =“ Rawi SRawiz perce “Raia! : Salle ads) 4 xmlDoc = new OoMDouament (5 = “Raja's Rasac lec ene = load (“shudents -xmt)) <Ibovm >Lby> $x = Yume DOC Fer lament Byraghame (Wee) =In Lingth-15 44493 #em($1) -9 node Type == I$ if (dx5 ttemm(4i) >chitdnvedes.5 item(o3 Mode Value == 4/3 4y = €4x 5 jtem( qi 9 porentnode), 43 <div id *stu details > 2b scudent détails wit) a ss ae be Wicked. cibociawys ied! <body> chimes bl ies ys PET 3 Weate 4 phone textbox @| check whekher it's starting with ©,7,3,4 & ly : ti ®b number shoud be 40 uy Wo tii eoraeab hormat , display Moortect data”, Else dis play Incoxvect dota ehtmts 2 body > <form method =“Post” action: "> label (er =“phone”s Phone Nlumber:</label> ‘ <Input type =Yext" id=“phone” name 2“phone" placwholder -"Dhone numbes Fequiredy < button type ="submit”> Submit <[button> ovTPVT: <Iform> Phone Nunbe: ar <I bodys [Eubmit] <lhtmt> <2 php> lovrect dala |Tnvovsect dats Tf (4-SERVER [*REQuEsT METH 0D] = =="POST D2 $phoneNumber = $_post]"phore’ J; if (salen (phone Number) ===10 && preg match (*/9 6-4/7 qphane echo “oyrut data” 3 else3 echo “Thurvect data’; 33 | a) tb username & tess than 5, display “less character" th password is less than 40, display ™ password must have akleast 40 chara Z1pocTYPE html> ZhtmL> chead> Zhtle> Registration Formélbtle> Z)head> Z body > 2h? Registralsen Form2/h2> Zfosm ackion="" method = “post'> clabel foo -“username’> Usemane : 2|Label> Zinput bype= text" id “usemame’ name-“usemame! required sbs>cbe Zlabul for =“password'> Password :¢]Label> Cinpat type="password" Vd = “password” name = “password required > bndb? <input type = “swbriit” Values “Reasster’s <|form> d —_— Z7 php > if C4-srever ['REQUEST- METHOD’ J === ‘Post’ ) $ Juserhame = 4-Post [username J 4 passwwor a= Post {*password Jj if (strlen(gusername)< 5 9 echo “Zp> Username must have atleast 9 charavters-<]p>"; % IF (sthten(4 password) < 10) 3 ‘i echo “cp>Password must have atleast 10 characters: [p> 5 3 2> Oukput : <body > Rogistration Fosm a Username, [4 es rer Username must have ableast 5 Unaractes Password must have atleast 10 charactos To_uptoad a File using PHP Zhtml> <body> <form action="‘file-php” method ="PosT enctype> multipart /form - daka'> <inpuk type =“file” name ="file’> <input type =“Submit" Valde="submit'> </form> <lbody> <2php echo “Filename: ”. 4 Fives file’) [name 22>); tho “Type :" « 4_FiLest file! I'type’J- %ba7", trp “gine 4o4 MGT Gieroa « “cbs>" teho “Temp name :" +4 0 f'bmp-name') « “coy3's the “Err: " «drives E'file'IDeroy’]- “¢ba>", print ($_ ENV f"ysep"y 9; iw <thtml> OUTPUT : [Gisacfie]* he ose [Ba Nuker choosing File Filename .csEuoou -WT-dex Vee: appicccction/ und openxmt formats offi cedocument: wWordpatessingm|: document Size : \uuuig Temp name: ¢ 2 \xampp \tm p\php USE. tmp Enos :0 1 CZ Pala CMe etaxslak 1) Design a calurlator using PHP <?php {FisstNumber - 9_Post | FirstNumbe J , 9 Second Number -4_Post 'SecondNmbes' J; Result = $_Post ['Resud’ ; function MyCale lator (} Numberd , INumbes 2, 4Result)3 Switch (fResul) 2 Cas “Addition’ ; $compute = $rtumbes4 + YNumbera ; neat 5 OUTPUT: case “Subtraction * Se 4compute = $number 4- {Number a; break case “Multiplication : compute = $number4 * 4 Number 2 ; break; Case “Division” : compu =$Number4 | $numberd ; break 3 Pebuan, Seompure 5 % echo “Result <br/> <ba/> Ast Number : $ Fasthumber 2b7/> gn Narnbes $e Numbuab? First, Number ; a Second Number: Cal Hak) Result: | aaa] | echo “Angwer is; ” + My calualator (Fast Numbos, $Sevonddlumber, 4Resull}s %> htm: hay Simple Calustalor <|h4><br> Fast Nuambor:einput name="nd" valve =" "Sebo> Second Number :cinput name = "na" yalue:* “yebr> input type = "submit" name="sub? Value "4"> {po ales 4 MOY x> “1S £b1> 2 <(npub type="text’ value -% 2b7> Result np ty alive <%php echo fans ; I"sebr> 3 </form> _—. pap fo {ind Lem ob two numbers using for loop : <% php qa =20; 4 4-a5; "Ed a>dys Jtemp=42,5 $a = dy; dy = qemp 53 for (ain yi 2 C924) ) $i 449 i (8x2 gf==0 4 4y/.4i=-0) § §qcd = 41 53 lem - C42 $y)78 qed ; echo “tem ob 9x and $y is-dlem’ %> Aomstieng number using form in php : <html> <body > <tomm method = “post's Enter the numbes : <input type =“number” name =“numbes’> < “Submit” value =“Submit’> <lhoams <lbody> </html> <2 php 16 (4_vosr dg Ynumiber = ¢_posy Chumber'3; 44 = 4number ; Isum=0, while Cay =0)$ drem -4a+/. lo: Ysum = gown + (4tem* grem* qaem) Ja =4a/\o % Se Using tlhe loop <?php 4$P =4x=20, 44-44 =25, While ($2) =4y)2 if (4u>4y7 2 4a =9x-$y 54 else 3 4y =4y-42 54 Ftem = (4p*gq)14a5 echo “Lem ef 4p and 44 is = glen"; e, 1f Ganumbes = =4sum) 3 echo S armstrong number”; 3 else § seho “not armstrong number’, 2> output: ist thw numbes, (coast tease 44 is rot axmsi9ong numbey Palindaome Numbes . a of <2 pnp FE C¥_post) 5 $num = Post (num, strev(4num); Y €§num = = I aeverse ds Geverce : €cho “The number Fnum is Patind some’; % sae 4 feho “The number $num is not Palindrome’ :3 4 ts EL pppoe siinwtiss $1 * ©. aid MwA: pr, “vadmamaagemenmin om Si ab ee aa ee ont Sopveom JSON fle 6.04 TQUERYNAUTAAT AN, How + ; json bile : Vesull yoon 3 “name” “John’, “age Mae SOs “sex “male” 3 chad > é litle > The J&Vay Example cite s D seipt set = https Mayax 4oogleapis ComJajas|tibs} jquery la V3) jquery min p> <script > i 4 cpr > 9 (document) ready Chunctiond}§ SHtecument-renety ¢ functor. FO Rd river") ck (fumciionlevent) § 3 get Ison Cresult: json’, bunctin@bj ) ¥ 3 (“Astage’) htt CZ po Name :? 4 Jd.name+ ‘dp>); SCH lage!) append Clep>ge : +jd-age + <p>); 4; ade 3) </script> <lhead> <body> <p> Cuck cn tu button to load aecuttehtme <divid =“ stage” style = <input Uype = “button” <I body > file :</p> “background ~ Wlor: Hov0"; > STAME Eldivy Vd “dives” Value -" load Data'/s Data -xmLd0C get E ByTagNam eu Emp aml le code Vanes (Employee, mployce : an coc c<Employees data > \ Ad TableR ows Fam XmIDoe GowData , a { <Employeesdabes id 1's OukputResuiy) ii ¢) <Saleshason sNANCY Zl6 > Lunitione ae Table CAMLNOde oy <THe >Sales tepresentatve d/ Title s élemplo Var the Table =vab\eNode Forentode, < mployees : tery! Var newRow) Newel ji 3 @ Id ="Q" @® = id="3” “ Console Log L“ Number eh nodes: a H <Itmployees datas ber liz0; ie xmNodes:tength » 144)§ Net code Nev» Row= table Nlode inser tRow gj, <'doctype htmts " sclassName = Cih2)? “oldpy! chtnt lang = en's Chead > <meta charsd = "VTF-¢"> <trtle > best handle Tesponse ¢[title> Vte)s <Saripts § “EVEN Row! bos Gj=0, je 7iMLNodes {iI childNodes ty NOWall -new Row sinserteot) Cent Rong Window: addEvent Listener ("Load functions Lucy qet Rowsia 3; TE Cemeniades Tid chitanedest,3 bunchion getRowsc)3 bostchitd) § Var xmLHttp =new XMLH tp Request) 5 Neweeul innerhtme =X MLNodes{} XMLHEp -open( “get” PEmploycedata-amly toue) ; chiaNodes [pt Nodevalue - XML Http omeacly State Chang. = bunchon()# or "LUN. ready State “= && this.stalus=200)5 teste aa ll showResult (this); % 355 console “hog (Catt, Jad] AmlHLtp send¢null); q ie ; Tunction show esultlamtttetp)y “PPend Child Ctablene Var xmiDo = XmUMEtp tes ponse xm , 3 document Element; Aemove White Spee Cxmibuc); Vat output Recwit > 4-4 Body Rows’), —_ = — ee x _—_——— function Yemove White Space Caml) Var loopTndex , bet WopTndex =05€ “ loopIndexc xmt child Nodec length 5 loop In dix ++ 93 Var cursentNode = 2m! ChildNiodeftoop Tdux) 5 ") (Current Node nodeType ==1) ¢ Aemove (White SprceCersrent Nate); 3 EONS /tes (Currentntode - node Values) 4G CGusreniniode NodeType = ¥me-FemoveChildCame childNodes {Loo pIndex}); 4 33 éKaipt > <SWle> table 5 a tds = 3) padding: apn, bordet : ipa soled tdadada } 3 Even Rows elon background allow ; 3 élayle> cbody > <table id “Main Table’> etnias “Body Rowe’ > dtbady 5 Zltables <bbody Dy <lhtml> Ful “height Side Navbar , Horizontal Nav bes : ~ style > éstyle> ut ' body t Ust -style-type <none ; marigins'0), 4 Margin 0; wl 4 padding +05 lst Style-type shone ; Over} low «hidden Margin so; b-c 342333; 3 Paddi nyo, ig ak = lept; 4 Width » a5 7h Me t Beak Was pement cle display : block 5 Positim « bixed 5 (lor : White; Nevghe : loo. text-aleqn ‘antes 3 SVerflow : Ouuto ) 3 Padding 3 ypn lopx ; lia 3 Output : bext-devoration : none; 4 deptay sblow ; . Ua shover snot Gctive) 3 telos . Hoon, | pony) Yackaround-colos UF (U3; 3 kb Padding: Spr tpx; | Rbow eachve text-decoration Mone ;3 background ~C #EFEFA,Y W a ative 3 <Istyles b-c: Hounneo ; <lheads Color = white 5 3 <body > & ashover Not Cackive )2 ae b-c :tisss <lhtmt> Colos shite ; 4 ! Alstyle> Sukpuk : <tbody> Home |About Oar ae i Se ime ae ‘ euya class active hret“tHhome 2Home clasgui, ws" eupall Habour Note: Here tref-# & Zbl> Jest Unk bub bet 2° : ge URS: CAN style margin -Llt :9s/. links we use ipadding):\p2 \ypx 5 heigh opr )"> 2ldiys <l body > aul class = "weckdays’s Zu >mo </u> =u We Th & Sa Su Zl cul class -“days’> <u>dchir E> <span dass "actives a9, Ispan>eti > Slt> ar ciuty 42> 3)</K> <lul> <Ibody > <dhtmis (Mo Tu we Th © Sa Su ro 2) Se 37 6 > 8 9 Td 2 1 jots 6 19 16 49 20 21 ‘M1 13 2h 25 2% 21:28 raed eu aq Bo 23) 2 todas “HM rs 4 ihe eT wal + it Mit ak Paget We i (Mao RES | ok Tai, Z\boctype htm > <html> ene a <head> SO & ee <style > ee ee eat > : Zz div class = “Neader > Headereii container 3 “Bide Na'> Sidenoys display : qa 5 “conkanl's Conbnt; Neaght ovh, “aside > Asidee qria template -columns : I]. 80/ 107-5 “Sookes"> Footer g quid SUPP VOWS ei 55g) <lav > </body> headers : <theml> b-c : aquamaaine 53 id " ste any beet rgb 166213143); 3 Grid-row m2] 33 qn4-column Ds} econtent 3 b-c. Orgbl222 16,15); Gvid-row : Ala, CO nid-column ; 9/9 « 4 353 _Huder ae easide 3 b-c. Urgb(233 120/200); x Side Now: aes Content Aside b-c , Frqbliaa 31/225); aid - column ¢ Y a 4 nen _ Footer “Container div 4 font-size .20pa, Cols ; white; Ais play + flery Jushfy-content « unter 5 aligh-ivems + unter: Ziewi 8 :
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved