Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

IE5 Dynamic HTML

You are here: irt.org | Books | IE5 Dynamic HTML [ previous next ]

IE5 Dynamic HTML is written by three different authors (Brian Francis, Alex Homer and Chris Ullman. As with many multi authored books, the work appears to have been divided up along chapters. Where one author has used JScript to demonstrate example code, another has used VBScript. Now this may have been a attempt to justify the inclusion of an VBScript Tutorial appendix and JScript and VBScript Reference appendices, but it makes it extremely difficult to reconcile the various examples written in different client scripting languages.

This book requires "a basic knowledge of a scripting language". Either the book should have stuck to VBScript (which only Internet Explorer supports), or it should have stuck to JScript (Microsoft's implementation of JavaScript). The later would have been preferred as this then would help when writing code for other vendors browsers.

The book has eight main chapters:

  1. Dynamic HTML - The Next Generation
  2. Style Sheets, Absolute Positioning and Z-Order
  3. The Dynamic HTML Browser Object Model
  4. The Dynamic HTML Document Object
  5. Scripts and Event Handling
  6. Manipulating the Contents of a the Page
  7. dialogs, Forms and Data Binding
  8. Introducing XML and Behaviours

How well does it cover these subjects, well skipping the first chapter, its coverage of CSS is fairly good, although CSS is a well established technology now, having been well supported in IE4 and Netscape Navigator 4, so nothing new here. However, the usage of JScript and VBScript to demonstrate features is badly flawed. Having first mentioned how to include scripting code within a document (therefore the authors are assuming that some of its target audience will be new to this) it then uses syntactically incorrect code, for example:

<IMG ID=MyImage SRC="mypic.gif" STYLE="position: absolute; top: 50;
                                left: 200; width; height:75">

Okay, nothing wrong here, they've demonstrated a simple HTML tag with style information, but then they show:

MyImage.style.top       'value is 50px
MyImage.style.left      'value is 200px
MyImage.style.width     'value is 150px
MyImage.style.height    'value is 75px

Have you spotted the flaw? Ignoring the missing <SCRIPT> and </SCRIPT> which are mentioned as being required in an earlier section, if you try the above in a page it will fail. Why, because firstly you are not told what scripting language is being used (its VBScript due to the comment style being used), but the VBScript statements are not valid syntax correct statements. They are expressions that will produce run time faults, as the expressions are neither operated on or changed. It would have been simpler to have used something like:

Dim top, left, width, height
Set top = MyImage.style.top          'value is 50px
Set left = MyImage.style.left        'value is 200px
Set width = MyImage.style.width      'value is 150px
Set height = MyImage.style.height    'value is 75px

At least this way anyone new to scripting wouldn't be frustrated with unexplained errors. Unfortunately this flaw is persisted through the book, along with the chopping and changing between VBScript and JScript, often without notice.

I'm even further surprised by the lack of the ubiquitous hover code, around since IE4:

A:hover {color:red}

<a href="http://www.irt.org/">irt.org</a>

This immediately introduces the effectiveness of Microsoft's DHTML implementation to newbies, and its absence from a book on Microsoft's Internet Explorer is disappointing. In fact, they do not mention this CSS notation at all. They mention using #idName for adding defining style to an element using the ID attribute, and .className for adding style to an element using like named CLASS attributes, and adding styles to types of elements using elementType.className, but not pseudo-elements or pseudo-classes, e.g. P:first-letter or A:hover.

Chapter 3 describes the Browsers Object Model adequately, again the Browsers Object Model hasn't changed a great deal since IE4, although it would have helped immensely if new methods, properties and objects had been marked as such. Not only is this padded out with many appendices of tabular methods, properties and objects, the main body of the book has a large number of these as well - with very little difference between the two. Although to be fair, this is typical of Microsoft Internet Explorer documentation, a trend instigated by Microsoft themselves. You want to know what's supported in IE3, IE4 and IE5 - you buy a book on IE3, a book on IE4, a book on IE5 and then compare them.

Chapter 4 is where this book is supposed to get interesting. With IE4 and NN4, both Microsoft and Netscape went off in their own directions for producing a dynamic object model, with the consequence that code written for one browser wouldn't work in another. Work by the W3C (World Wide Web Consortium) attempted to resolve this by creating a DOM (Document Object Model) Recommendation, that would describe how a complete document could be accessed - in a vendor neutral manner. Thus introducing the ability to interact with any part of a documents Object Model by traversing a hierarchy of objects.

Seeing as, currently, IE5 is the only browser that offers any form of support for the DOM, this subject would have been idea for a book covering IE5 Dynamic HTML. Unfortunately the authors seemed to have glossed over this feature in IE5.

Take, for example, the new method createTextNode - used to add extra items of text within the current document. Look up createTextNode in the index and there are two references (page 329, 103). Page 103 includes createTextNode in a list of methods available, and has this to say about createTextNode: "Creates a text string". Page 329 (part of the extensive appendices) includes createTextNode in a long list of methods available, and has this to say about createTextNode: "Syntax: TextNode = document.createTextNode([Text]) - creates a text string from the given Text". That's it! No working example, no description of how to make use of this method, no indication of why it might be useful.

This chapter does have a fairly good description of collections and how to filter collections, but then doesn't seem to have much of an idea of what to do with them once filtered. It also describes in some detail the existing Multimedia filter effects - available since IE4.

Chapter 5, one of the better chapters, gives some fairly well documented examples, pointing out the new event handling features available in IE5.

Chapter 6 covers "Manipulating the Contents of the Page" - an ideal subject to go over the DOM in fine detail? No chance. Reverts to innerText, outerText, innerHTML, outerHTML, insertAdjacentText, insertAdjacentHTML and Text Ranges. All of which have been available since IE4 as Microsoft proprietary extensions - and none of them supported by the W3C DOM Level 1. A full 34 pages covering IE4 features (albeit enhanced slightly in places) compared with two lines on createTextNode. A missed opportunity.

Chapter 7, again is one of the better ones, covering some of things handled well in IE4 and IE5: "Dialogs, Forms and Data Binding" - helped immensely with IE5's support for HTML 4.0. This chapter has some of the best working examples of form and modal dialogs I have seen. Although its coverage of Data binding does not match that in another Wrox title "IE4 Programming".

Chapter 8, introduces XML and behaviours, and although fairly short at 24 pages, makes a reasonable attempt to describe these two features. Although the XML support in IE5 does deserve a book in its own right - "XML IE5" by Wrox.

This book also provides a total of 11 appendices:

  1. The Browser Object Model
  2. DHTML Properties, Methods and Events
  3. Dynamic HTML Tags
  4. Common HTML Tags by category
  5. CSS Properties
  6. HTML Color Names and Values
  7. Special Characters in HTML
  8. A Tutorial in VBScript
  9. VBScript Reference
  10. JScript Reference
  11. Support and Errata
  12. A grand total of 262 pages of appendices out of a total of 551 pages for the whole book. Eighteen of which are spent listing names of colors.

    All in all, a disappointing book, possibly due to the lack of interesting new features in IE5, but also due to the missed opportunity to cover the DOM in any great detail. The authors obviously know IE4 very well, but their knowledge of IE5 is not extensive by any means.

    Recommendation: if you are interested in the technologies introduced in IE4 - buy an IE4 book (preferably the excellent Wrox book "IE4 Programming".) If you want to learn about IE5 support for the DOM - look elsewhere. If you must have a definitive reference of all the methods, properties and objects available for support of DHTML in IE5 but don't mind the lack of examples or description of their use, then buy this book - alternatively browse the better online material on Microsoft's Developer web site.

    Available to buy from: Amazon.com, Amazon.co.uk or Amazon.de

    You are here: irt.org | Books | IE5 Dynamic HTML [ previous next ]

    ©2018 Martin Webb