Slashdot Mirror


Dynamic HTML The Definitive Reference (2nd edition)

TheThinMan writes "This is the completely updated second edition. Four years ago I made the first edition my constant companion and it has saved me, and any other web developer nearby, weeks of head-scratching since. Back then we had to tussle with Netscape Navigator 4 vs. Internet Explorer 4 while supporting the version 3 browsers. Though the browser war is over and all sides have vastly improved their products, DHTML has moved on. This edition brings home just how much has changed and just how much is new. Most importantly, it helps you to develop web interfaces that will be cross-platform from the outset." TheThinMan's thoughts on the book continue below. Dynamic HTML The Definitive Reference (2nd edition) author Danny Goodman pages 1400 publisher O'Reilly rating 10 reviewer TheThinMan ISBN 0596003161 summary The most complete reference work for HTML, DOM, CSS and Javascript, cross referenced for all the major browsers and standards.

What's in the book?

The book is not an introduction to DHTML but it does have an 183-page section on Applying DHTML that covers not only the current state of the art but also gives clear guidance in making use of all the features. The guidance is of a good enough standard that a firm's Quality program could simply cite this book as the basis for the web development standards that a team adopts. Goodman makes it very clear that he is not going to discuss the DHTML that Navigator 4 introduced, the <layer> tag and JavaScript style rules, but points out that they are covered in the first edition should you really need to know.

The layout of the book is the same as the first edition, with the reference sections divided into HTML, DOM (Document Object Model), CSS (Cascading Style Sheet) and JavaScript. A new section for Events also makes an appearance. The reference sections on HTML and DOM have sub-sections that precede them on the shared attributes of all elements. These are particularly useful and I think should be committed to memory.

There is also a very curious Cross Reference section that has an HTML/XHTML attribute index and a DOM property, method and event handler index. It takes each HTML/XHTML attribute and shows which elements support it and then each DOM scriptable object property, method and event and which objects support it. I'll confess I've never had any call to use this section but I can see how it could come in handy -- and it hardly takes up much dead tree.

The upper limit of standards coverage is HTML 4.01, XHTML 1.1, CSS Level 2, DOM Level 2, and JavaScript (or ECMAScript) 1.5. The browsers considered are IE6 (Windows), IE 5.1 (Mac), Netscape Navigator 6 and 7 and Mozilla 1.0. Opera is also mentioned in the section on Applying DHTML in that it mostly follows the IE DOM. The timeline for any element can go back as far as HTML 3.2, Navigator 2 or IE 3.

As you would expect, there are some useful appendices: Color Names and RGB Values, which I expect to be using more now as sites are required to meet Accessibility guidelines; HTML Character Entities, for when you don't have a copy of Macromedia Dreamweaver or when your favourite HTML editor doesn't have a complete list; Keyboard Event Character Values, for your scripts when you want to catch all those key presses; Internet Explorer Commands, which along with the MSHTML.dll can allow the creation of a very neat content editor quite quickly and easily; and finally, an HTML/XHTML DTD Support cross-reference that may help catch validation errors as you move from an HTML 4.01 Transitional DTD to a full-on XHTML 1.0 Strict DTD.

What makes it worth having?

The quality of Danny Goodman's writing is both technically accurate and easy to read. The clarity and lack of fluff is good, but there is no skimping on detail where such is needed to illuminate a point. Let's face it: web development is not as complex as most software engineering or systems development tasks, but it is a discipline with quite a wide base, reflected in the 1400 pages of this tome. I wouldn't trim any of it, however, and I expect that after about a year of use I will have referred to a good proportion of the contents. Take, for instance, Goodman's estimate that there are more than 15,000 unique instances of properties, methods, and event handlers supported by numerous document objects and you get an good impression of the size of the documentation required.

The book could be regarded as two books in one: There is the Applying DHTML book and the Reference book. The best things about the reference sections are the excellent descriptions, the clear little examples, and especially the quick summary of where you can expect these things to be supported. Referring to this book is the simplest way to avoid going down the proprietary browser extension cul de sac.

The Applying DHTML section is worth reading all the way through. It is great for getting yourself into the various technologies and seeing how they are meant to work. There are interesting points made on how each of the technologies are evolving. There's material contrasting the various DOM implementations and there are chapters on style sheets, positioning in CSS, making the content dynamic (of course, this is what DHTML is all about, after all) and scripting events.

There is a very useful cross-platform API for DHTML (which can be downloaded as a zip file along with the other examples from the book on O'Reilly's web site). I've used the version from the first edition quite a lot, and I've used the new version in my most recent work. It doesn't rely on browser version sniffing, but rather on object detection, which is explained with some examples, and can be easily extended to handle any DOM call you may wish to make. The API is especially useful for any CSS positioning tasks you may have. Goodman also goes over other strategies you can adopt to make your sites cross-platform, such as page branching, designing for a common denominator, and some other, neater, solutions.

There isn't anything on Accessibility other than a single paragraph drawing your attention to the Web Accessibility Initiative (WAI). DHTML and Accessibility could be considered inimical but that isn't the case and I'd perhaps have liked to see this elaborated on with some suggestions on how to achieve an Accessible site while still using DHTML. In practice, however, I've found it easy to meet the Priority 1 checkpoints (or A rating) set by the WAI even with a complete DHTML site so perhaps this is not really an issue.

I find this book really useful. I can't imagine any web developer doing without this book and managing to produce a good cross-platform solution, and I also can't imagine that developer needing any other texts on any of the technologies covered here. I certainly don't have any others on my desk today.

The O'Reilly web site has a complete Table of Contents available. You can purchase Dynamic HTML The Definitive Reference from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

12 of 243 comments (clear)

  1. Beginner Book by peterdaly · · Score: 5, Informative

    This book, as he says, "is not an introduction to DHTML". If you are looking for a book to get started with DHTML, I highly reccomend Essential CSS and DHTML for Web Professionals (2nd Edition), by Dan Livingston. I learned most of my DHTML fundementals from the first edition, and recently purchased the second edition as well. This is a very short book, an unlike many of its kind, can be read almost in "novel" form to get a basic overview without getting bored. You can then go back and try the examples, and actually implement some DHTML. Without a doubt one of the best web development books I have gotten.

    -Pete

  2. The war is over? by Proudrooster · · Score: 5, Funny

    Though The browser war is over ...

    To borrow a quote from my friend, "John 'Bluto' Blutarski" who spent most of his college career on double secret probation.

    Was it over when the Nazi's bombed Pearl Harbor?
    Well it ain't over now!!!!!!


    The browser wars won't be over until Mozilla stomps IE.
    Other than that, the book sounds excellent!

  3. Re:DHTML standard? by larien · · Score: 5, Interesting

    That's a good point; much as I'd love to add stuff to my web pages, I don't want to block out some of the lower denominators such as lynx or, possibly more importantly, software such as readers for the blind. If DHTML screws up on those, you're losing a portion of your audience; not perhaps a large one, but it's still there.

  4. DHTML standards set by W3C and ECMA by yerricde · · Score: 5, Informative

    figure out if any DHTML techniques have become standards.

    DHTML means manipulation of the HTML DOM through ECMAScript. The HTML DOM is a W3C Recommendation, and ECMAScript is a European international standard.

    --
    Will I retire or break 10K?
  5. Can one person be expert on all of these topics? by dbaron · · Score: 5, Interesting

    This book covers a huge amount of material. After all, DHTML is just a name used for the interaction of a bunch of different things, and this book seems to try to cover all of them. I wonder whether Goodman is really an expert on all of it (or whether anyone can be). I'd be a lot more comfortable trusting a book like this if it were written by a group of authors with different areas of expertise.

    Looking at what I can find about the book's coverage of CSS (which I know a lot about), I'm not optimistic. He seems to make up his own terminology, which can cause significant confusion in any public discussions. He uses the word "attributes" instead of "properties" (e.g., the CSS 'position' property) in the sample chapter available at O'Reilly. This is a mistake that's become very common these days, perhaps due to earlier editions of this book, and causes lots of confusion when people really need to discuss attributes (in HTML). The table of contents also shows sections titled by terms that he seems to have made up: "Common Subgroup Selectors" and "Advanced Subgroup Selectors".

    It could be that he's decided he doesn't like the terminology used by the CSS specification so he's making new terminology. Such a decision has significant costs for communication between and among web developers and standards organizations. However, I fear it may not even be a conscious decision, but rather than he just doesn't know enough about CSS to know the correct terminology. (Not that I would expect any one person to be able to learn enough about all the topics covered in this book to be an authority on all of them.)

    (If you want a good book on CSS, look for Eric Meyer's books on CSS, one of which is also published by O'Reilly.)

  6. My DHTML book, FREE (full text in post): by veddermatic · · Score: 5, Funny

    Chapter 1

    Don't use DHTML. It's pain in the ass. If you want "cool" stuff that makes Web sites non-accessable, use Flash. You only have to write one set of code then.

    --
    Department of Homeland Security: Removing the rights real patriots fought and died for since 2001
  7. Complexity by Anonymous Coward · · Score: 5, Insightful

    "Let's face it: web development is not as complex as most software engineering or systems development tasks"

    You obviously never had to cope with developing a complex web application. When done right, it's a task far more complex than "conventional" software engineering.

    Rich client-side interface doesn't mean a mouse-cursor tracker or validating your form on the client-side. It means letting the client side do ALL your application logic and interface, seperately. And let the server do the dumb job of validating, saving and returning raw data that can be handled by client-side custom components or logic-flow.

    Not as complex? No, even more complex, if you're doing anything worthy.

  8. Don't be an idiot by ShieldW0lf · · Score: 5, Insightful

    Anyone who develops sites for corporates is going to be using DHTML to make it appealing and easy to use. I develop internet apps for a living, and I use DHTML all over the place in my development. You can make some VERY effective user interfaces with DHTML... I've used it in my sites to create extremely flexible/dynamic forms that pass sophisticated information in a single form that would require 5-6 round trips to the server without it. You quite obviously have no idea what you're talking about. Perhaps you should stop spewing crap and learn a little about the subject before you mouth off.

    --
    -1 Uncomfortable Truth
  9. Re:DHTML in Mozilla? by veddermatic · · Score: 5, Insightful

    this is a result of people confusing Micro$fot with the W3C.

    IE supports both the "right" way and an M$ only way of doing things.

    So it's quite easy to write one set of code that ie5+ and Mozilla use to dothe same thing. However, thanks to certain organizations promoting the other way of doing things, some web devs write code that only works in IE.... which then perpetuates taht "all other browsers but IE suck" because "wow, look how good it works in IE but it breaks in _____."

    --
    Department of Homeland Security: Removing the rights real patriots fought and died for since 2001
  10. Re:Little market for this book.... by bigmouth_strikes · · Score: 5, Interesting

    You obvisouly don't know what you are talking about.

    Well-used Javascript and DHTML is harder to recognize than the obvious stuff you come across as popups and various ad-schemes. Apparently, you pull stats ("99.9999%") out of your ass and try to pass your opinions as facts. Are you in the industry, or is your main experience that as a surfer ?

    There is tremendous power to DHTML and Javascript, and it is widely used in commercial sites. It allows the user to interact with the otherwise dead html in ways that help the user and the site.

    For a great example, look at International Herald Tribune. You can select articles from the frontpage and put them in a "clippings" folder - no you don't have to login - and then you can read them all later on. No more "open in a new window". For individual articles you can select how it will presented; font size, colums per page etc. This is an example of a site that is usable and intuitive thanks to Javascript, in this case.

    So, get a clue to what you are talking about.

    --
    Oh, I can't help quoting you because everything that you said rings true
  11. Re:DHTML vs Server Side scripting by xutopia · · Score: 5, Informative

    DHTML was relevant when it appeared with the advent of 4.0 browsers and it is even more today because there is more coherance

    A truly interactive site will require server side processing of information if it wants to be of any value. DHTML allows you to present information in a way someone can interact with it (sorting a table of data on the client side, form validation, having mutliple layers of information on a page).

    DHTML becomes essential in web applications like a billing software that doesn't require software to be installed on the client side.

    Something going against the usage of DHTML is the browser war and support for standards still not being as respected as Mozilla. Netscape 4 is the worst thing that happened to DHTML. It made lots of things impossible to do or hard to do. Anyone still using NS4 should upgrade to allow developers to create real web sites. Another thing going against DHTML is the fact that lots of people begin programming with it and too many beginners try useless flashy things that hurt the people that can actually do nice things in DHTML.

    The last web application I did for www.b-process.com processes bills eletronically and uses a web interface compatible with IE4 and up and Mozilla/NS6+. Lots of features like attaching a note to a bill are achieved through the usage of DHTML. Another interesting thing was that we save download time by sending only bill data instead and let the DHTML layer format the information on the client side saving up to 80% of bandwith.

    DHTML is relevant today and will be more once NS4 is dropped completely. I'm glad I could answer your question! :)

  12. Re:DHTML in Mozilla? by Jugalator · · Score: 5, Insightful
    I'm not a web developer, but I've heard that DHTML support in Mozilla is pretty bad

    Not as long as you follow the current standards (DOM). If you do that, both IE and Mozilla has rather good "DHTML" support. It's funny that there's a way to write decent cross-browser pages that's dynamic and all that and that this way is even standardized, while many web developers *still* refuse to realize facts and continues to struggle with Microsoft's document.all model, having to disable parts of pages to make them cross-browser, etc. Is it lack of education? Brainwashing? :-)

    The site I'm thinking of is Citibank's credit card management section

    Yeah, and just by looking at the source code at their login screen I see tons of non-standard DHTML code so it's no surprise it isn't working well at other browsers than IE.

    I'm talking about this:
    if ((frm.USERNAME.value == "") || (frm.PASSWORD.value == ""))
    {
    alert("Please enter your User ID and Password to sign on");
    frm.USERNAME.focus();
    return (false);
    }
    See that frm.USERNAME rubbish?
    If they had just changed that fragment to this:
    var usr = document.getElementById("USERNAME");
    var pwd = document.getElementById("PASSWORD");

    if ((usr.value == "") || (pwd.value == ""))
    {
    alert("Please enter your User ID and Password to sign on");
    usr.focus();
    return false;
    }
    .. and it might have worked a lot better on Mozilla (while still maintaining 100% compatibility with IE! *gasp*). Look above at the incredible effort spent too.
    --
    Beware: In C++, your friends can see your privates!