XML Basic
XML HOMEXML Introduction
XML How to use
XML Tree
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Validator
XML Viewing
XML CSS
XML XSLT
XML JavaScript
XML HTTP RequestXML Parser
XML DOM
XML to HTML
XML Applications
XML Advanced
XML NamespacesXML CDATA
XML Encoding
XML Server
XML DOM Advanced
XML Don't
XML Technologies
XML in Real Life
XML Editors
XML Summary
XML Examples
XML ExamplesXML Quiz
XML Certificate
XML Applications
| « Previous | Next Chapter » |
This chapter demonstrates some small XML applications built on XML, HTML, XML DOM and JavaScript.
The XML Document Used
In this application we will use the "cd_catalog.xml" file.
Display the First CD in an HTML div Element
The following example gets the XML data from the first CD element and displays it in an HTML element with id="showCD". The displayCD() function is called when the page is loaded:
Example
Try it yourself » |
Navigate Between the CDs
To navigate between the CDs in the example above, add a next() and previous() function:
Example
Try it yourself » |
Show Album Information When Clicking On a CD
The last example shows how you can show album information when the user clicks on a CD:
For more information about using JavaScript and the XML DOM, visit our XML DOM tutorial.
| « Previous | Next Chapter » |
