Docsity

Browser Object Model (BOM) and Document Object Model (DOM) Overview, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Browser Object Model (BOM) and Document Object Model (DOM) Overview and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

1

THE B ROWSER O BJECT

M ODEL (BOM)

BOM vs. DOM

Web through browser BOM. controlled

Web through page DOM. controlled

2

BOM Object Hierarchy

window

Root Object of the ModelDocument

JavaScript Window Object

Window Object Reference: http://www.javascriptkit.com/jsref/window.shtml

4

Opening a new browser window

window.open (p1, [p2, p3, p4]) p1: p2: 2 ttarget. t BlBl ankk ( ( or new name)) opens new window.i d Existinghttp://einstein.etsu.edu/~pittares/CSCI3110/examples/7 window or frame, opened there. โ€5.htm p3: controls window attributes using attribute/value pairshttp://einstein etsu edu/~pittares/CSCI3110/examples/7 6 htmhttp://einstein.etsu.edu/ pittares/CSCI3110/examples/7 in a single string. โ€ 6 .htm p4:

Setting timeouts

setTimeout(p1, p2) p1: string specifying function or a function definition p2: (^2) http://einstein.etsu.edu/~pittares/CSCI3110/examples/7โ€7.htm Returnshttp://einstein.etsu.edu/~pittares/CSCI3110/examples/7 timeoutID โ€8.htm clearTimeout(timeoutID)http://einstein etsu edu/~pittares/CSCI3110/examples/7 9 htmhttp://einstein.etsu.edu/ pittares/CSCI3110/examples/7โ€ 9 .htm

5

Browser dialogs

Modal:

Nonโ€modal:

http://einstein.etsu.edu/~pittares/CSCI3110/examples/7โ€10.htm

Window.navigator

Browser detection and information http://www.javascriptkit.com/jsref/navigator.shtml

7

Window.screen

Allows detection of information related to the user's screen. htthttp://www.javascriptkit.com/jsref/screen.shtml // j i tkit /j f/ ht l

Recommended BOM Resource

http://javascript.about.com/od/browserobjectmodel/Browser_Object_Model.htm