Web Programming
Web Programming
Lecture 4 ? JavaScript and HTML Documents
The JavaScript Execution Environment
? Browsers display XHTML documents in a window, which is an object in its own right. JavaScript has a Window object that represents the window displaying the document.
? All JavaScripts can see the various properties of the Window object.
? Every Window has a Document object that represents the display XHTML documents, which has properties of its own.
1
Window Object
History
Location
Document
Link
Anchor
Text
Form
Select
Radio
Checkbox
Textbox
Button
Password Submit
Options Reset
The Document Object Model
? DOM (Document Object Model) is an API (Application Programming Interface) that defines an interface between HTML documents and application program.
? It is an abstract model that applies to a variety of programming language.
? Essentially, the various structures in an HTML document that are marked up with tags are considered objects, complete with properties and methods.
? The attributes of an HTML tag corresponds to a property for the corresponding object.
2
A table in XHTML
A simple document
Apple Orange
Breakfast 1 0
3
DOM Structure of the Document
Document
"A simple document"
Apple Orange Breakfast 0
1
DOM ? An Example
? The following tag:
corresponds to an object, which has two properties type (which is text) and name (which is address).
4
Element Access in JavaScript
? Manipulating elements in an HTML document requires that you have the address of the corresponding object.
? This can be handled in several different ways, depending on which version of DOM to which you seek to conform.
? The address of a JavaScript object associated with an HTML element is called its DOM address.
Sample XHTML document
Access to form elements
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- tutorial javascript switching panels using a radio button
- study guide august wilson s radio golf trinity repertory company
- number c rn lrn dodgc t lj ram service bulletin date
- subject information on procedure to unlock delco radio with theftlock
- sap analytics cloud custom widget developer guide
- kerrville tx 78028 project scale field drafting checked js cm bm
- city of fresno 120015 radio dispatcher definition supervision received
- radio jupiter pro
- jsf h selectoneradio
- web programming
Related searches
- basic java programming examples
- java programming examples pdf
- java programming for beginners pdf
- excel programming examples
- macro programming in excel
- comcast programming schedule
- vba programming cheat sheet pdf
- excel visual basic programming examples
- programming in excel
- learning java programming pdf
- basic java programming examples pdf
- programming practice java