SlideShare a Scribd company logo
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

More Related Content

What's hot

HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
jeroenvdmeer
 
HTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifitsHTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifits
Pro Guide
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
Jeanie Arnoco
 
Html ppt
Html pptHtml ppt
Html ppt
Ruchi Kumari
 
Learning Html
Learning HtmlLearning Html
Learning Html
Damian Gonz
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
palhaftab
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
Mai Moustafa
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
Jayapal Reddy Nimmakayala
 
Html basics
Html basicsHtml basics
Html basics
mcatahir947
 
Html
HtmlHtml
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
Hamza Zahid
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
Singsys Pte Ltd
 
Intro Html
Intro HtmlIntro Html
Intro Html
Chidanand Byahatti
 
Basic html
Basic htmlBasic html
Basic html
Drew Eric Noftle
 
Basic Html Notes
Basic Html NotesBasic Html Notes
Basic Html Notes
NextGenr
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 

What's hot (20)

HTML5 & CSS3
HTML5 & CSS3 HTML5 & CSS3
HTML5 & CSS3
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
HTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifitsHTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifits
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
 
Html ppt
Html pptHtml ppt
Html ppt
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Html basics
Html basicsHtml basics
Html basics
 
Html
HtmlHtml
Html
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Intro Html
Intro HtmlIntro Html
Intro Html
 
Basic html
Basic htmlBasic html
Basic html
 
Basic Html Notes
Basic Html NotesBasic Html Notes
Basic Html Notes
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 

Viewers also liked

Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )ITSTB
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
rahul kundu
 
Dom
Dom Dom
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
Brian Moschel
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
Partnered Health
 
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 SpecificationOtakism
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
XML and XPath details
XML and XPath detailsXML and XPath details
XML and XPath details
DSK Chakravarthy
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
Webtech Learning
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
Om Vikram Thapa
 
Xpath
XpathXpath
XPath - XML Path Language
XPath - XML Path LanguageXPath - XML Path Language
XPath - XML Path Language
yht4ever
 
XSLT
XSLTXSLT
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-FOSuite Solutions
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & eventBorey Lim
 
學習JavaScript_Dom
學習JavaScript_Dom學習JavaScript_Dom
學習JavaScript_Dom
俊彬 李
 

Viewers also liked (20)

Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
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)
 
Dom
Dom Dom
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
 

Similar to Document Object Model

Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
Laurence Svekis ✔
 
Web components
Web componentsWeb components
Web components
Noam Kfir
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
vikasmittal92
 
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 Technologies
Perttu Myry
 
Document object model
Document object modelDocument object model
Document object model
Amit kumar
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
Damalie Wasukira
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
zonathen
 
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
Nagamurali Reddy
 
HTML5
HTML5HTML5
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
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
Michael Anthony
 
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
AppUniverz 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 faridabad
Css Founder
 
Introductory css and j query
Introductory css and j queryIntroductory css and j query
Javascript
Javascript Javascript
Javascript
poojanov04
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMING
Prof 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 work
Albino Tonnina
 

Similar to 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
 
Document object model
Document object modelDocument object model
Document object model
 
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
 

Recently uploaded

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 

Recently uploaded (20)

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 

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