|
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:
- Dynamic HTML - The Next Generation
- Style Sheets, Absolute Positioning and Z-Order
- The Dynamic HTML Browser Object Model
- The Dynamic HTML Document Object
- Scripts and Event Handling
- Manipulating the Contents of a the Page
- dialogs, Forms and Data Binding
- 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:
<head>
<style><!--
A:hover {color:red}
//--></style>
</head>
<body>
<a href="http://www.irt.org/">irt.org</a>
</body>
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:
- The Browser Object Model
- DHTML Properties, Methods and Events
- Dynamic HTML Tags
- Common HTML Tags by category
- CSS Properties
- HTML Color Names and Values
- Special Characters in HTML
- A Tutorial in VBScript
- VBScript Reference
- JScript Reference
- Support and Errata
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
|