0% found this document useful (0 votes)
106 views74 pages

IP Module 1 To 3

Uploaded by

Shubhi Parashar
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)
106 views74 pages

IP Module 1 To 3

Uploaded by

Shubhi Parashar
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/ 74
mm MODULE 1 Web Programming Fundamentals CHAPTER 1 Working of web browser, HTTP protocol, HTTPS, DNS, TLS, XML introduction, JSON introduction, DOM, URL. URI, REST API Self Study. Noinx serve 1.1 Three tier Web Architecture : eee 18 : Ua, Drawand illustrate Stier Web Architecture. SUENENRENSIIIIY ..cccsncesncnsnnnsnanna j 4 1.2 Web Browser. i 1-3, 124 What is a Browser ?.......... 13 i 1.22 Features of Web Browser ; 4 123 Component of a Web Browser. 14 124 — Working of Web Browser... 1.3 HTTP protocdl... 1.31 Features of HTTP on. 132 HTTP Request / Response 1.33 HTTP Transactions... 1.34 How does HTTP Work? BA HTTPS oosnseumne 141 HITPSys. HTTP... 142 Advantage of hts. 1.4.3 Howdoes HTTPS Work ? | 15._DNS (Domain Name System) 1.5.1 How Does DNS Work? AAO 1-10 1.6 TLS (Transport Layer Security). 18.1 The Benefits of Transport Layer Security. 1.62 The Challenges of TLS. 1.63 Differences between the SSL and TLS. wt A 112 | : ming Fun = Internet Programming (MU Sem 8-1) (wed Prog 22 96 (1 17 XML ~ va Explain XML and DTD with an example ET te 17.1 XML Usage ty 172 XML Propertios hy ig 1.73 XML Syntax . DE [ Explain the concept of Element and Attributes 'n XML 174 XML Text M4 17.5 XML Validation tag 1754 XMLOTD 145 1.752 XML Schema te 1753 DTDvsxsD 17 1.75.4 CDATAvs PCDATA. 1.8 JSON. UO. What do you mean by JSON. [TEE ESTSSIEIE 1.8.1 JSON Introduction.. 7 1.82 Features of JSON 1.8.3 JSON Example 1.8.4 JSON Object. 1.85 JSON Array, Saeed 1.9 DOM (Document Object Model)... 1.9.1 XMLDOM 1.92 HTMLDOM. . 1.9.3 _Levelsof DOM:Level 0:Provides a Lowiovel Set of interfaces 1.10 URL (Uniform Resource Locator) 1.41 URI 1.12 REST API... 4.12.1 Principles of REST API... 1.12.2 REST API Methods... 4.13 Self Study: NGINX Server... 4.13.1 What is NGINX?. 4.13.2 Why use NGINX?. 4.13.3 Features of NGINX 1.19.4 Installing NGINX on Windows 4.13.5 Apache vs. NGINX.. © Chapter Ends... (New Syllabus w.e f academic year 21-22) (MS-78) fech-Neo Publications...A SACHIN SHAH Ventu® Intornot Programming (MU - Sem 5 -1T) Gq. Draw and ilustate3-ter Web Architecture : SCL architecture 4s an architecture patter used in Thee ‘applications as a specific type of client-server system. = Thee Tier Web Architecture 1s that unique system of developing web database application which works around the {tier model comprising of database tier at the bottom, the the middle and the elient tier at the top, application ter = This comprehensive 3 tier architecture module is the framework for most Web Applications on the Internet, This system helps to separate the Business Logic from the Application, Data Storage and database. 1 architecture, the different layers are developed = Ina three ‘and maintained as different modules, sometimes on different platforms as well. The following are the functions of each layer "= Presentation Tier “The presentation ter occupies the top level ofthe application. It sends content to browsers in the web development frameworks, such as CSS, HTML, or JavaScript, and displays information in the form of a graphical user interface (GUD, which allows ‘users to can access directly. It communicates with other layers by putting out the results to the browser and other tiers through API calls. © Application Tier = The application tier is also called the business logic, logic tier, or middle tier. By processing the business logic for the application, it builds a bridge between the presentation layer and the data layer to make communication faster between the presentation and data layer. = The application tier is usually coded in Ci, Java, CH, Python, Ruby. ete © Data Tier Datactier is composed of persistent storage mechanism and the no. (1-3) (Web Programming Fundamontals) Module to perform insert, update, delete, get dats from the database 1 based on our input data Hp result Hip query query answer Web cere Database driver Intermediate language! scripting (anFig. LLL: 3-tier Web Architecture ‘=r advantages 1 Improved Data Integrity 2. High Degree of Flexibility in deployment platform and configurations, Improved security High Performance and persistent objects Architecture is scalable, adding users and resources in future would be easy Maintenance and modifications can be done effectively Code and data reusability can be achieved " Disadvantages |. 3 tier architecture is complex compared to 1-tier and 2-tier. 2. Cost of network maintenance and deployment is greater than 1- tier and 2-ter. Dy 1.2 WEB BROWSER 1.2.1 What is a Browser ? 1 GQ. What is web browser? Discuss working of web f browser in detail. (QO Marks) | — A browser is a software program that is used to explore, retrieve, and display the information available on the World data access layer. It supports connecting with the database and ‘Wide Web. This information may be in the form of pictures, (New Syllabus w.e.f academic year 21-22) (MS-78) ‘ech-Neo Publications... SACHIN SHAH Venture orev and coteporine withthe Det of URLs (Ueto Resource Mewwifien) Hor enampie toe a viewing Ou Pat By won» teow (A browne (8 9 ccm progam as # rant ok # one COMPU (OF chile device and comma the ecbenrver for the (mtorammcon guest! by the weet The wet server sends the (date Nah to the Prowner thas Sepays the resus eterna suppor! dence On heal of the waer the teowner sends request to web server all ever the iemnet by esing HTT? (Hypertext Transfer Promcol). A. throwser requires smary omc, compute, tables and aterm 19 woMk ~ Example of Web Browsers: Chrome, Firefox. IE, Nemcare. ‘Sader. Bdge, Opera, UC Browser, Vivaki ote. TR 1.2.2 Features of Web Browser Most Web tromen offe common feature sac 2 1. Refresh button : Refresh button allows the webate to reo stents of the wed pages. Most of the web browsers store ocal copies of visited pages to enhance the performance by swing 2 caching mechanism Sometimes. it stops you from sceing the updated information, inthis case, by chcking 00 the Sefeoch butom, you one see the updatl information. 2 Stop betton : His used to cance! the communication of the ‘web browser with the server and stops loading the page ‘comtcat. For example, if any malicious site eaters the browser accidentally, it helps t0 save from it by clicking 08 the stop bute. 3. Home button < It provides wsers the option to bring up the predefined home page of the webs, 4. Web address bar: It allows the wsers 10 enter 2 web adress in “the adress bar and visit the website S. Tabbed browsing > It provides users the option 1 open: muitiple websites on a single window, It helps users to read, different. websites at the same fime, For example, when you seach fr anything on the brown, proses you » lst of E for your query. You can ope all the results by » ighn-cticking on each link, staying on the same page. 46 Bookmarks: Wt llows the one 0 select particular website ‘gave it for the Inter retrieval of information, which sefelatein: New Syllabus wef academic year 21-22) (M578) “ = CDEDED |» (pang. 1.2.1: 3-tier Web Architecture ser Interface :The wet interface is naa whey maacaeerserers. TE forward button, menu, bookmarking. and many ate options to interact withthe browser Browser Engine : It connects the UI (User the rendering engine as a bridge. It queria ‘manipulates the rendering engine based on ip fog ‘several user interfaces. 7 = Chrome & Opera 15+ use Blink . Chrome (Phone) & Safari use WebKit [Networking + It retneves the URLs by protocols like HTTP or FTP. It is ‘maintaining all aspects of Internet ‘tamy be used 0 reduce network traffic. ew yocatec: | sateen Internet Programming (MU - Sem 5 - IT) (Web Programming Fundamentals) _Page no (1-5) > JavaScript Interpreter : As the name suggests. JavaSenpt Interpreter translates and executes the JavaSenpt code, which 1s ancluded in a website The translated results are sent to the rendenng engine to Seater. wee mace ~ XML can work behind the scene to simplify the creation of ~ — HTML documents for large web sites. 4 [in SSL Secure Socket [In TLS (Transport Layer ~ XML can be used to exchange the information betweea Layer), Message digest is | Sccunty), Peeudo-random a used to create master secret_| function is used to create abate master secret = _ XML can be used for offloading and reloading of databsses (New Syllabus wef academic year 21-22) (M5-78) ‘Tech-Neo Publications..A SACHIN SHAH Venture Intemet Programming (MU - Sem 5 - 1) XML can be used to store and arrange the data. which can customize your data handling needs XML can easily be merged with style sheets to create almost any desired output ‘Virtually, any type of data can be expressed as an XML document. % 1.7.2 XML Properties XML 1s a markup language that focuses on data rather than ‘how the data looks. XML 1s designed to send, store, receive and display data. In simple words you can say that XML 1s used for storing and transporting data. XML became a W3C (W3C stands for World Wide Web Consortium, the main international standards organization for the World Wide Web) recommendation on February 10, 1998, XML is different from HTML. XML focuses on data while HTML focuses on how the data looks. “XML does not depend on software and hardware; it is platform ‘and programming language independent. Unlike HTML where most of the tags are predefined, XML. doesn’t have predefined tags, rather you have to create your own tags. 1.7.3 XML Syntax Sug. Bplain the concept of Element and Attributes in {XML Subhash <More 1234567890 ‘There are two kinds of information in the above example ‘Markup, like the The text, or character data,Subhash, ‘Moreand 1234567890. Fig. 1.7.1 depicts the syntax rules to write different types of markup and text in an XML document. New Syllabus w.e.f academic year 21-22) (M5-78) (MOF ig:.7.1 : XML syntax rules 1. XML Declaration “The XML document can optionally have an XML declaration Itis writen as follows <” where “xml” is writen in lower-case 1 document contains XML declaration, then it strictly needs to be the first statement of the XML document. UTE-8"2> ‘The XML declaration strictly needs be the first statement in the XML document. ‘An HTTP protocol can override the value of encoding that you putin the XML declaration, 2. Tags and Elements ‘An XML file is structured by several XML-clements, also called XML-nodes or XML-tags. The names of XML-elements are ‘enclosed in triangular brackets © as shown below: ‘ Syntax Rules for Tags and Elements Element Syntax : Each XML-clement needs to be closed cither with stat or with end elements as shown below: ... Nesting of Elements : An XML-clement can contain multiple XML elements as its children, but the children ‘elements must not overlap. ie, an end tag of an element must have the same name as that of the most recent ‘unmatched start tag. Tech-Neo Publications... SACHIN SHAH Venture later nternet Programm (Web Programming Fundamentats ng (MU- Som -m) a petite cocusengar Symbol & which sa served character ana egy eee “ XML has two types of references ea ‘PranitGaikwad< ‘Lastname> 1234567800 ‘S/eontact-info> Root Element : An XML document can have only one oot element, ‘The Following example shows a comely fomed XML document ~ Gase Sensitivity : The names of XML-clements are case- Sensitive. That means the name of the start and the end is different from 3. XML Attributes An attribute specifies a single property for the element, using a name/value pair. An XML-element can have one or more attributes. For example : ‘XML Attributes Here href is the attribute name and hitp://www.xml.comy is attribute value. Syntax Rules for XML Attributes — Attribute names in XML (unlike HTML) are case sensitive. That is, HREF and href are considered two different XML attributes. Same attribute cannot have two values in a syntax. The following example shows incorrect syntax because the attribute b is specified twice. Attribute names are defined without quotation marks, whereas attribute values must always appear in quotation marks. Following example demonstrates incomect xml Entity References: An enbty refers cy tron th sr the en ett Fe 9g where amp is name, The name refers to a le, 0 text andor markup. a Character References: These contin fog, fas, conan ash mack) flour The mmberalvays fers the Unease? In tis case, 65 refers to alphabet "A" sa 1.7.4 XML Text The mumes of XML-clements and XML-attbute, sensitive, which means the name of stat and eng need to be written in the same case. To avon Sve encoding problems, all XML files should te Unicode UTF-8 or UTF-16 files. ~ Whitespace ciancters Tike Bln, tbs an tang Setween XMLlements and between the XML ae will be ignored. XML Tree Structure ~ An XML document has self descriptive stuct fing tre structure which is referred as an XML te. Th structure makes easy to deseribe an XML document — A tree structure contains root element (as para ¢ clement and so on. It is very easy to travers all cen branches and sub-branches and leaf nodes string fom root, ‘Example of an XML document ‘ Snehal More 09990449935 [email protected]
Mumbsi syntax, ‘Maharashtra 4. XML References 201007 References usually allow you to add or include additional text | or markup in an XML document. References always begin with the ‘ a (New Syllabus w.ef academic year 21-22) (MS-78) Tealtech-Neo Publcations..A SACHIN SHAHVE# EO ”dLdmlc Ll a <_—<— CC In the above example, first ine 4s the XML declaration. It defines the XML version 1.0. Next line shows the root clement (college) of the document Inside that there 1s one ‘more element (student), Student element contamns five branches named , , , - and
address> branch contains 3 sub-branches named , - and . 1.7.5 XML Validation {A well-formed XML document can be validated against DTD (or Schema. A well-formed XML document is an XML document with correct syntax. Valid XML document [must be well formed (satisfy all the basic syntax condition) It should be behaving according to predefined DTD or XML_ schema Rules for well-formed XML Jemust begin with the XML declaration. Itnmst have one unigue root element. All start tags of XML documents must match end tags. ‘XML tags are case sensitive. All elements must be closed. ‘All elements must be properly nested. All axibutes' values must be quoted. ‘XML entities must be used for special characters. XML DTD ADITD defines the legal elements of an XML document DID defines the document structure with a list of legal clements and attributes. ‘XML schema is an XML based alternative to DTD. DID and XML schema both are used to form a well-formed XML document. We should avoid errors in XML documents because they will ‘stop the XML programs. XML schema Itis defined as an XML language Uses namespaces to allow for reuses of existing definitions It supports a large number of built-in data types and efinition of derived datatypes 1.7.5.1 XML DTD s GQ. Explain the term Document Type Definition (OTD) Rg (20 Marks) | = DID stands for Document Type Definition. It defines the legal building blocks of an XML document. It 1s used to define document structure with a list of legal elements and attributes. Its main purpose is to define the structure of a9 XML document. It contains a list of legal elements and define the structure withthe help of them. ~ Before proceeding with XML DTD, you must check the validation. An XML document 1s called “well-formed” if rt contains the correct syntax. A well-formed and valid XML document is one which have been validated against DTD. Valid and well-formed XML document with DTD Lets take an example of wellformed and valid XML document. It follows all the rules of DTD. ‘employeesxm < Vivian Lobo [email protected] In the above example, the DOCTYPE declaration refers to an extemal DTD file ‘employeedtd Description of DTD IDOCTYPE employee: It defines that the root element of the document is employee. — Let's see a code to define the ENTITY in doctype declaration. author.xmt ‘ SIENTITY ay "Alice John"> > ‘ &aj; A 1.7.5.2 XML Schema cZE5 Faceae= — XML schema is a language which 1s used for expressing constraint about XML documents. There are so many schema Janguages which are used now a days for example Relax- NG and XSD (XML schema definition) — An XML schema is used to define the structure of an XML. document. It is like DTD but provides more control on XML structure. Am XML document is called “well-formed” if it contains the correct syntax. A well-formed and valid XML document is ‘one which have been validated against Schema. XML Schema Example ‘employee.xsd (New Syllabus w.e.f academic year 21-22) (M5-78) © It defines theo name employee. o = It defines that he elemeat npg, ‘complex type. : = cassequence> : It defines that the comple ype 5 sequence of elements ~~ de that the element ‘email ss of string/text type. XML Schema Data types ‘There are two types of data types in XML schema = simpleType = complex Type simpleType The simpleType allows you to have text-based deme! Contains less attributes, child elements, and cannot be left eam? [Bl rech.Neo Publications..A SACHIN SHAH Ve Internet Prograrwtung (MU Sem 5 IT) complexType “The complesTYPE allows you by okt mie lements Ian contain aditional su elements and «an be tefl emp Ww 1.7.5.3 DTD vs XSD GQ. Differentiate between DTD and XSD_ There are many differences between DTD (Document Type Definition) and XSD (XML Schema Definition) In short, DTD provides less control on XML strcture whereas XS. (XML schema) provides more contol pr xsD DTD stands for Document Type | XSD__ stands for XML Definition ‘Schema Definition DTDs are derived from SGML | XSDs are wniten in XML, syntax DTD doesn't support datatypes. | XSD supports datatypes for clements and attributes. DTD doesn't support XSD supports namespace namespace. DTD doesn't define order for | XSD defines order for child child elements clements DTD is notextensible XSD is extensible DTD is not simple to learn XSD is simple to leam because you don't need to learn new language DTD provides Jess control on | XSD provides more control XML structure, on XML structure, ‘%& 1.7.5.4 CDATA vs PCDATA net ' GQ, Differentiate between CDATA and PCDATA. 4 CDATA CDATA : (Unparsed Character data) : CDATA contains the text which is not parsed further in an XML document. Tags inside the CDATA text are not treated as markup and entities will not be (Web Pro et take <€Paml version "17> <1DOCTYPE employee SYSTEM “employee tl! > Priyanka <€lastnaine > Mariguckdi < piyuin@ gmail comm fetal > > Inthe above CDATA example, CDATA 1s used ust after the clement employee to make the datwtext unpansed, so at wall ve the value of employee Pryankc/frstnne>Manguddie/Masin ‘ame>-email> pryum@ ginail com PCDATA = PCDATA : (Paned Character Data). XML parers are wed to parse all the text in an XML document PCDATA stands for Parved Character data. PCDATA 1s the text that wall be parsed by a parser. Tags inside the PCDATA will be treated 1s markup and entities will be expanded. = Apparsed character data means the XML parser examune the ata and ensure that it doesn't content entity ft contains that will be replaced Example <1DOCTYPE employee SYSTEM "employee.did"> < Kbyati Vashi[email protected] In the above example, the employce clement contains 3 more cloments ‘firstname, ‘lastname’, and ‘email’, so it parses further to set the data/text of firstname, lastname and email to give the value ‘of employee as Khyati Vashi khyativ@ gmail.com. expanded. (New Syllabus w.e.f academic year 21-22) (M5-78) a Tech-Neo Publications...A SACHIN SHAH Venture 1 SON ‘atonal for tepinners and professionals provides deep Knowledge of ISON echnology Our JSON tutor will help you 9 eam JSON fundame encode, decode, file, date. hey tals, example, sytax, aay, objets and date format. JSON Introduction ISON stands for JavaScript Object Notation. JSON is an open standard data-interchange format, JSON is lightweight and sett describing. ISON 1s originated from JavaScript ISON is easy to read and write. JSON is language independent. SON supports data structures such as aay and objects. 1.8.2 Features of JSON Simplicity Openness Self Describing Intemnationalization Extensibility Interoperability auewn WS 1.8.3 JSON Example JSON Example 1 {"employees":[ {"name"."Piyu", “email”:"[email protected]"}, {'name"."Khyati", “email":"[email protected]"), {"name":"Inu", "email":“[email protected]"} R ‘The XML representation of above JSON example is given below. Sourabh [email protected] (Web Programming Fundamentai) Sanyu < [email protected] < « Projakla [email protected] JSON Example 2 {%menu’: { “popup”: { “menuitem: [ {"value"; ‘New’, ‘onclic {"value”: "Open", “onclick” "OpenDoc()", {value "Save", onclick”: "SaveDoc("} ] } hn The XML representation of above ISON ex ANE sy below. ‘ “OpenDoc()" /> ‘menuitem value="Save" onclick="SaveDoo("> ‘ 1.8.4 JSON Object JSON object holds ‘key/value pair. Fach key is represented 51 String in JSON and value can be of any type. The key ad wl ‘are separated by colon. Each key/value pair is separated by cama ‘The curly brace { } represents JSON object, Lets see an example of JSON object. { "employee": { “nane": Sei “married’: true } } ee en Internet Programming (MU - Som 6 - 7) In the above example, employee ts an object m which “name”, “salary” and “mamed” are the key. In this example, there are string, number and boolean value for the keys. JSON Object with Strings ‘The sting value must be enclosed within double quote { ge "email "Venn", “[email protected]” ) JSON Object with Numbers JSON supports numbers in double precision floating-point format. The number can be digits (0-9, fractions (33, 532 ete) and exponents (¢, e+, ¢-E, E+, E). { "integer": 34, "fraction": 2145, “exponent”: 6.61789¢+0 ¥ JSON Object with Booleans JSON also supports boolean values true or false { "firsts true, "second: falve , JSON Nested Object Example AJSON object can have another object also. Let's see a simple ‘example of ISON object having another objec. { “finsName"* "Bob, "astName': "John", "age": 30, "address": { “streetAddress!: "Woodland Complex’, "eity": "Mumbai’, "otate': "Maharashtra", "postelCode": "201007" (New Syllabus w.e.f academic year 21-22) (M5-78) (Web Programming Fundamentals) _.Page no_ (1-19) 1.8.5 JSON Array JSON array represents ordered list of values. JSON array can store multiple values It ean store string, number, boolean or object in SON array In JSON array, values must be separated by comma, ‘The [ (square bracket epresents ISON array JSON Array of Strings Let's see an example of SON arrays storing string values TPSulday®, "Monday", "Tuesday", "Wednesday", "Thureday, "Friday", "Seturday"] JSON Array of Numbers: Lets see an example of SON arrays storing number values [12, 34, 56, 43, 95] JSON Array of Bool: Lets see an example of ISON arrays storing boolean values [uue, true, false, false, true} ISON Array of Objects Let's see a simple ISON array example having 4 objects "employees": {"name':"Chetana’, "email":"chetanam@ gmail.com", “age’:31}, {*name!:"Prajakta’, “email":'[email protected]", “age’:28), {"name":"Gauri","email’:'[email protected]", "age":18}, {"name":"Vidye’, "email’:"[email protected]", “age":32) » TT 1 1.9 DOM (DOCUMENT OBJECT MODEL) OO ' GQ. What is DOM? Explain different types of DOM, 1 (10 Marks) Ait ewe ce nena ‘The Document Object Model (DOM) is @ programming interface for HTML and XML (Extensible Markup Language) documents, It defines the logical structure of documents and the ‘way a document is accessed and manipulated. The Document Object Model (DOM) is a W3C standard. It defines a standard for ‘accessing documents like HTML and XML. DOM is @ way to represent the webpage in a structured hierarchical way so that it will become easier for programmers and users to glide through the document. With DOM, we can easily access and manipulate tags, IDs, classes, Attributes, or Elements using commands or methods provided by the Document object. [al tech-Neo Publications..A SACHIN SHAH Venture i meine Programming (MU - Sem 5-17) bor fines the objects and properties and methods iffercn, 12 MCE all XML clements it as separated 1010 3 ferent parts / levels Gere DOM : standard model for any structured document XML DOM : standard model for XML documents HTML DOM : standard model for HTML documents 1.9.1 xML DOM ~ XML DOM is a standard object model for XML. XML documents have a hierarchy of informational units called nodes, DOM 1s a standard programming interface of ‘describing those nodes and the relationships between thet. ~ As XML DOM also provides an API that allows a developer {0 add, edit, move or remove nodes at any point on the tee in order to create an application. ‘Advantages of XML DOM ‘The following are the advantages of XML DOM. (1) XML DOM is language and platform independent. (2) XML DOM 1s traversable - Information in XML DOM is organized in a hierarchy which allows developer to navigate ‘around the hierarchy looking for specific information, (3) XML DOM is modifiable - It is dynamic in nature providing the developer a scope to add, edit, move or remove nodes at any point on the tree. ‘Disadvantages of XML DOM (1) It consumes more memory (if the XML structure is large) as Program written once remains in memory all the time until and unless removed explicitly. (2) Due to the extensive usage of memory, its operational speed, ‘compared to SAX is slower. ws 1.9.2 HTML DOM ‘The HTML DOM is a standard object model and programming interface for HTML. It defines : ‘The HTML elements as objects ‘The properties of all HTML elements ‘The methods to access all HTML elements ‘The events for all HTML elements (New Syllabus w.ef academic year 21-22) (MS-78) “Te properties ofthe document object that can modified by the document object. fe = Window Object : Window Object fs alway, 8 hierarchy. re Document object : When an HTML document ‘a window, it becomes a document object, Form Object Its represented by form tag, — Link Objects + Tt is represented by lnk tags — Anchor Objects: It's represented by are tag, Form Controt Elements Form can have imag, elements sich #8 lxt fells, butons, radio ty cheokbones 6 Se Document Sa “iy ‘chan Text Dom Mode! (AMnFig. 1.9.1 : Document Object Model Methods of Document Object write(“string”): writes the given string on the document getElementByld(: returns the element having the gives 4 value. = getBlementsByName(: returns all the elements havg te siven name value. — getBlementsByTagName(): returns all the elements hig the given tag name, = getBlementsByClassName(): returns all the elements havig the given class name, 1.9.3 Levels of DOM: Level 0: Providesa Low-level Set of Interfaces Level 1 : DOM level 1 can be described in two parts: CORE#! HTML. CORE provides low-level interfaces that can be ws" represent any structured document. [Blrech-neo Publications..A SACHIN SHAH Vent eae Internet Programming (MU - Sem 5 - IT) HIML provides high-level interfaces that can be used 10 represent HTML documents Level 2: Consists of six specifications: CORE2, VIEWS, EVENTS, STYLE, TRAVERSAL, and RANGE. ‘CORE2: extends the functionality of CORE specified by DOM level 1 VIEWS. views allow programs to dynamically access and ‘manipulate the content ofthe document. EVENTS: Events are scripts that ar either executed by the browser when the user reacts tothe web page. STYLE: allows programs to dynamically access and manipulate the content of stylesheets ‘TRAVERSAL: allows programs to dynamically traverse the document RANGE: allows programs to dynamically identify a range of content inthe document. Level 3: Consists of five different specifications: CORE3, LOAD ‘and SAVE, VALIDATION, EVENTS, and XPATH. CORES: extends the functionality of CORE specified by DOM level 2 LOAD and SAVE: allows the program to dynamically load the content of the XML. document into the DOM document and save the DOM Document into an XML document by senalization VALIDATION: allows the program to dynamically update the content and structure ofthe document while ensuring the document remains valid. EVENTS: extends the functionality of Events specified by DOM Level 2 XPATH: XPATH is a path language that can be used to access the DOM tree. Example of DOM manipulation ‘ DOM manipulation Enter Value 1 (Web Programming Fundamentals)... Page no. (1-21)
1 Enter Value 2

-

<Instagram
    • Scribd - Download on the App Store
    • Scribd - Download on the App Store
    Language: