SlideShare ist ein Scribd-Unternehmen logo
1 von 20
CONTENTS
1.WHAT IS DOCUMENT OBJECT MODEL ?
2.WHERE THE DOM CAME FROM ?
3.HOW THE WEBPAGE IS LOADED AND DISPLAYED?
3.1. THE REQUEST
3.2. THE RESPONSE
3.3. THE PARSING
3.4 THE BUILT
4.WHAT IS NODE ?
5.ADDING SOME TEXT TO A PAGE
6.BEST WAY TO THE GET ELEMENT
7.CONCLUSION
8.REFERENCES
2
What is Document Object Model ?
 Document Object Model (DOM), a programming interface specification
being developed by the World Wide Web Consortium (W3C).
 DOM is the browser’s internal programmatic representation of the
Webpage.
 Can be manipulated by language like JavaScript.
 Set of hierarchical collection of objects/elements.
3
WheretheDocumentObjectModelcamefrom?
"browser wars" of the late 1990s between Netscape Navigator
and Microsoft Internet Explorer.
1996 within Netscape Navigator 2.0
“DOM Level 0" or "Legacy DOM”
W3C in late 1998 - > 2000 introduce.. DOM Level 1 and 2.
2005, large parts of W3C DOM were well-supported
by common ECMAScript-enabled browsers
4
HOWTHEWEBPAGEISLOADEDANDDISPLAYED?
Technically there are four steps of a webpage being displayed
 Request
 Response
 Built
 Render
Each of these steps are often performed several times during a page load.
5
The Request
 The most common way a webpage is requested is when a link is clicked,
but requests also occur when a page is refreshed, or when a url is typed
into a browser.
 The moment when a webpage is requested is also called "navigation
start".
 It is basically the moment where the whole process of displaying a page
begins.
 When a linked is clicked a request is made for a document
6
The Response
 The web server then provides the file to the web browser. The response
is simply the browser receiving the thing it had requested.
 However, most webpages have things like images, videos, flash movies ,
External CSS and External JavaScript file.
 These are called resources and in order to display the webpage the web
browser must get those page resources as well.
7
Parsing
 Translate the HTML into series of recognizable tokens
 The web browser looks at the entire HTML document and looks for any
CSS, JavaScript and images that are referenced by the page.
 The images, CSS, and JavaScript that the HTML file references will be
downloaded by the browser.
 It’s main job is to recognizable token into tree of related object
8
The Build
There are basically three steps that the browser takes to build a page.
 Build the DOM
 Build the CSSOM
 Build the Render Tree
9
Building the DOM
 The Rendering engine will then use that tree of object to determine
where we position element on screen.
 The developer then able to use JavaScript to interact with tree of
related object through number of properties and method
 Each object inherits at the point it was instantiated
10
<!DOCTYPE html>
<html>
<head>
<title>Understanding the Document Object Model</title>
<script type="text/javascript" src="script13.js"></script>
</head>
<body>
<h1 id="title“>Understanding the Document ObjectModel</h1>
<p id="first">This is the first paragraph</p>
<p id="second">
<strong>Second paragraph</strong>
</p>
<p id="third">Third paragraph</p>
<input type="submit" id="clickMe" value="Click Me" />
<a href="http://www.bing.com" id="myAnchor">Bing!</a>
</div>
</body>
</html>
11
Hierarchyof an exampleof DOM
12
13
What is a Node?
The DOM presents documents as a hierarchy of Node objects that also
implement other, more specialized interfaces.
 Element Node – contains an HTML tag
 Text Node – contains text
 Text Nodes are contained in Element Nodes
14
Adding Some Text To A Page
 Create a new Element
[document.createElement(“p”)]
 Create a Text Node
[document.createTextNode(“Some text.”) ]
 Attach the New Text Node to the New Element
[newNode.appendChild(newText)]
 Find an Existing Element
[document.getElementById(“thisLocation”)]
15
Best way to the get Element
getElementById() allows you to work with elements by
their individual id but often you will want to work with a
group of elements
var clickMeButton = document.getElementById('clickMe');
getElementsByTagName() allows you to work with
groups of elements. This method returns an array
16
Early Lifecycle of Web page
17
CONCLUSION
There's much more to the Document Object Model than what's been
covered here. Styles add a whole new dimension to content
presentation and events provide a means to make pages interactive with
the user. But these topics deserve their own discussion. The methods
provided to navigate it and manipulate different types of nodes. This will
give you a solid foundation for dealing with other features of the DOM
18
REFERENCES
1. https://en.wikipedia.org/wiki/Document_Object_Model
2. https://www.youtube.com/watch?v=SmE4OwHztCc
3. https://www.w3c.org/DOM/
4. https://varvy.com/pagespeed/display.html
19
20

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Dom
DomDom
Dom
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Css colors
Css   colorsCss   colors
Css colors
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
CSS
CSSCSS
CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
PHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and SessionsPHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and Sessions
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Introduction to XHTML
Introduction to XHTMLIntroduction to XHTML
Introduction to XHTML
 
Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
 
CSS
CSSCSS
CSS
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
 
Files in php
Files in phpFiles in php
Files in php
 
jQuery
jQueryjQuery
jQuery
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 
XML
XMLXML
XML
 

Andere mochten auch

Andere mochten auch (20)

DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
 
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Dom structure
Dom structureDom structure
Dom structure
 
Document Object Model (DOM) Level 1 Specification
Document Object Model (DOM) Level 1 SpecificationDocument Object Model (DOM) Level 1 Specification
Document Object Model (DOM) Level 1 Specification
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
XML and XPath details
XML and XPath detailsXML and XPath details
XML and XPath details
 
JavaScript and DOM
JavaScript and DOMJavaScript and DOM
JavaScript and DOM
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
Xpath
XpathXpath
Xpath
 
XPath - XML Path Language
XPath - XML Path LanguageXPath - XML Path Language
XPath - XML Path Language
 
XSLT
XSLTXSLT
XSLT
 
Overview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FOOverview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FO
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
 
學習JavaScript_Dom
學習JavaScript_Dom學習JavaScript_Dom
學習JavaScript_Dom
 
Javascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsJavascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basics
 
Xml dom
Xml domXml dom
Xml dom
 

Ähnlich wie Document Object Model

Web components
Web componentsWeb components
Web componentsNoam Kfir
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.Arshak Movsisyan
 
Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojoyoavrubin
 
Modern Web Technologies
Modern Web TechnologiesModern Web Technologies
Modern Web TechnologiesPerttu Myry
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoDamalie Wasukira
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
How Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul IrishHow Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul IrishNagamurali Reddy
 
Unlearning and Relearning jQuery - Client-side Performance Optimization
Unlearning and Relearning jQuery - Client-side Performance OptimizationUnlearning and Relearning jQuery - Client-side Performance Optimization
Unlearning and Relearning jQuery - Client-side Performance OptimizationJon Dean
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slideshelenmga
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabadCss Founder
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGProf Ansari
 
Html css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers workHtml css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers workAlbino Tonnina
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance TipsRavi Raj
 

Ähnlich wie Document Object Model (20)

Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
 
Web components
Web componentsWeb components
Web components
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
 
Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojo
 
Modern Web Technologies
Modern Web TechnologiesModern Web Technologies
Modern Web Technologies
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
How Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul IrishHow Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul Irish
 
HTML5
HTML5HTML5
HTML5
 
Unlearning and Relearning jQuery - Client-side Performance Optimization
Unlearning and Relearning jQuery - Client-side Performance OptimizationUnlearning and Relearning jQuery - Client-side Performance Optimization
Unlearning and Relearning jQuery - Client-side Performance Optimization
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabad
 
Introductory css and j query
Introductory css and j queryIntroductory css and j query
Introductory css and j query
 
Javascript
Javascript Javascript
Javascript
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMING
 
Html css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers workHtml css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers work
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance Tips
 

Kürzlich hochgeladen

𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...SUHANI PANDEY
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 

Kürzlich hochgeladen (20)

𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 

Document Object Model

  • 1.
  • 2. CONTENTS 1.WHAT IS DOCUMENT OBJECT MODEL ? 2.WHERE THE DOM CAME FROM ? 3.HOW THE WEBPAGE IS LOADED AND DISPLAYED? 3.1. THE REQUEST 3.2. THE RESPONSE 3.3. THE PARSING 3.4 THE BUILT 4.WHAT IS NODE ? 5.ADDING SOME TEXT TO A PAGE 6.BEST WAY TO THE GET ELEMENT 7.CONCLUSION 8.REFERENCES 2
  • 3. What is Document Object Model ?  Document Object Model (DOM), a programming interface specification being developed by the World Wide Web Consortium (W3C).  DOM is the browser’s internal programmatic representation of the Webpage.  Can be manipulated by language like JavaScript.  Set of hierarchical collection of objects/elements. 3
  • 4. WheretheDocumentObjectModelcamefrom? "browser wars" of the late 1990s between Netscape Navigator and Microsoft Internet Explorer. 1996 within Netscape Navigator 2.0 “DOM Level 0" or "Legacy DOM” W3C in late 1998 - > 2000 introduce.. DOM Level 1 and 2. 2005, large parts of W3C DOM were well-supported by common ECMAScript-enabled browsers 4
  • 5. HOWTHEWEBPAGEISLOADEDANDDISPLAYED? Technically there are four steps of a webpage being displayed  Request  Response  Built  Render Each of these steps are often performed several times during a page load. 5
  • 6. The Request  The most common way a webpage is requested is when a link is clicked, but requests also occur when a page is refreshed, or when a url is typed into a browser.  The moment when a webpage is requested is also called "navigation start".  It is basically the moment where the whole process of displaying a page begins.  When a linked is clicked a request is made for a document 6
  • 7. The Response  The web server then provides the file to the web browser. The response is simply the browser receiving the thing it had requested.  However, most webpages have things like images, videos, flash movies , External CSS and External JavaScript file.  These are called resources and in order to display the webpage the web browser must get those page resources as well. 7
  • 8. Parsing  Translate the HTML into series of recognizable tokens  The web browser looks at the entire HTML document and looks for any CSS, JavaScript and images that are referenced by the page.  The images, CSS, and JavaScript that the HTML file references will be downloaded by the browser.  It’s main job is to recognizable token into tree of related object 8
  • 9. The Build There are basically three steps that the browser takes to build a page.  Build the DOM  Build the CSSOM  Build the Render Tree 9
  • 10. Building the DOM  The Rendering engine will then use that tree of object to determine where we position element on screen.  The developer then able to use JavaScript to interact with tree of related object through number of properties and method  Each object inherits at the point it was instantiated 10
  • 11. <!DOCTYPE html> <html> <head> <title>Understanding the Document Object Model</title> <script type="text/javascript" src="script13.js"></script> </head> <body> <h1 id="title“>Understanding the Document ObjectModel</h1> <p id="first">This is the first paragraph</p> <p id="second"> <strong>Second paragraph</strong> </p> <p id="third">Third paragraph</p> <input type="submit" id="clickMe" value="Click Me" /> <a href="http://www.bing.com" id="myAnchor">Bing!</a> </div> </body> </html> 11
  • 13. 13
  • 14. What is a Node? The DOM presents documents as a hierarchy of Node objects that also implement other, more specialized interfaces.  Element Node – contains an HTML tag  Text Node – contains text  Text Nodes are contained in Element Nodes 14
  • 15. Adding Some Text To A Page  Create a new Element [document.createElement(“p”)]  Create a Text Node [document.createTextNode(“Some text.”) ]  Attach the New Text Node to the New Element [newNode.appendChild(newText)]  Find an Existing Element [document.getElementById(“thisLocation”)] 15
  • 16. Best way to the get Element getElementById() allows you to work with elements by their individual id but often you will want to work with a group of elements var clickMeButton = document.getElementById('clickMe'); getElementsByTagName() allows you to work with groups of elements. This method returns an array 16
  • 17. Early Lifecycle of Web page 17
  • 18. CONCLUSION There's much more to the Document Object Model than what's been covered here. Styles add a whole new dimension to content presentation and events provide a means to make pages interactive with the user. But these topics deserve their own discussion. The methods provided to navigate it and manipulate different types of nodes. This will give you a solid foundation for dealing with other features of the DOM 18
  • 20. 20