DHTML

DHTML - Learning by Example

Dr. Robert B. Mellor    See also .... Buy DHTML book XML ASP
DHTML - FAQs DHTML - Afterword

This book is aimed at becoming the standard text book for introductory courses on Dynamic HTML programming. It contains 26 examples of DHTML coding, with each followed by a detailed explanation. Theory, tips and new concepts are introduced "along the way", both in the body of the text as well as in the examples.

This book describes very briefly and in plain language, the elements and attributes in HTML and shortly compares the 3.2 and 4 versions of HTML to XHTML. The Microsoft Document Object Model (DOM), is then introduced, where elements are considered to be objects. The CSS hierarchical model is explored using HTML and XML examples, followed by client-side scripting using JavaScript and VBScript. Finally, the latter third of the book illustrates "Dynamic Scripting", the combination of CSS, DOM and JavaScript.

Experience shows quite clearly, that if you sit down at your PC and read/work through the book, you will be able to do most DHTML programming within a few days.

For this work you will ideally have a 4+ version Internet Explorer browser (MSIE4+) from Microsoft. This is available free from microsoft.com (http://www.microsoft.com). For Example D you will need a 5+ version Internet Explorer browser, however it can be displayed in Internet Explorer 4, if you add the XML parser (called "msxml"), which is available free from microsoft.com (http://msdn.microsoft.com/downloads/webtechnology/xml/msxml.asp). This is the only example where you will need an XML-enabled browser.

You will need a graphics program in order to make some simple GIF files. The Windows program MS-Paint, is sufficient. If you have others, like Adobe Photoshop in 4+ version, or Corel Draw, then you will not need their more advanced features.

An ASCII text editor is sufficient to write the code examples described in this book.

Contents

Introduction
The Author
Disclaimer
Symbols and Conventions
DHTML
The Various HTMLs and XHTML
Cascading Style Sheets - CSS
Example A: Inline Style
Example B: Declared Style in the Style Element
Example C: Linked External Style Sheets
The Cascade in Cascading Style Sheets
Example D: Linked External CSS in XML
Example E: Absolute Positioning
Example F: Relative Positioning
Example G: Background Color and Background Graphics
Example H: Element Dimensions
Summary of CSS: Links
Summary of CSS: Selectors
Summary of CSS: Pseudo-classes
JavaScript
Client-Side JavaScript
Comments in JavaScript
JavaScript Objects
JavaScript Statements & Variables
Further Reserved Words
Variable Types
JavaScript Functions
JavaScript Operators
JavaScript Conditional Statements
Example I: Calling JavaScript
Example J: Object Model and Collections
An Overview of Event Handlers:
Example K: Variables and Methods
Example L: Functions and Parameters
Example M: Conditional Statements and Loops
Example N: Conditional Statements, Operators and Standard Functions
Home Exercise 1: Forms and Arrays, a 24 hour On-Line Pizza Bar
Example O: Arrays
Example P: Environmental Variables and Browser Check
Example Q: Setting Cookies with JavaScript
VBScript
Example R: Data-Binding using Dynamic VBScript
Dynamic Styles
Example S: DOM, Specifying the Background Color.
JavaScript Colors
Example T: Dynamic Positioning
Positioning: Length Value Units
Home Exercise 2: Dynamic Graphics & Audio; Sniping at Layers
Example U: Dynamic Forms.
Regular Expressions
Example V: One Practical Use for RegExp.
Home Exercise 3: onFocus, onBlur and Regular Expressions
Example W: Drop-Down Menus
Example X: Movement using Timer Functions
Time-Related Properties of the Window Object
Example Y: Pre-Loading Mouse-Over Effects
Home Exercise 4: Pre-Loaded Images, an Art Gallery
Example Z: Timed Linked Graphical Sequence
Appendix A: Keyword Reference
Appendix B: Overview of Objects
Appendix C: Overview of Methods
Appendix D: Overview of Properties
Appendix E: Further Information on the Internet


Return to overview