Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Books Media Book Reviews IT Technology

Dynamic HTML The Definitive Reference (2nd edition) 243

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.

This discussion has been archived. No new comments can be posted.

Dynamic HTML The Definitive Reference (2nd edition)

Comments Filter:
  • by cerebralsugar ( 203167 ) on Tuesday October 29, 2002 @10:23AM (#4555861)
    Used copies of first edition are pretty darned cheap. [amazon.com]
  • Beginner Book (Score:5, Informative)

    by peterdaly ( 123554 ) <petedaly@ix[ ]tcom.com ['.ne' in gap]> on Tuesday October 29, 2002 @10:25AM (#4555875)
    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) [bitworm.com], 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
    • Re:Beginner Book (Score:2, Informative)

      by DopeRider ( 611535 )
      I highly reccomend Essential CSS and DHTML for Web Professionals (2nd Edition)

      I also used this book as a quick reference. But I'm afraid I didn't like it at all. The sample code didn't work most of the time. I found myself writing code just to test a feature that was suposed to work.

    • Other help (Score:2, Informative)

      by Laura_007 ( 621429 )
      Sometimes an even better approach would be to study the code existing out there first, such as the excellent code offered up by exitfuel [google.ca]. One of the most important pieces of code is the window.open function, and onload and onleave of the body element. Once you have them mastered, along with the Document Model of Objects, you have a good grounding for some serious Flash programming. There are some pretty intense workarounds necessary for some of the mechanisms that people have in place nowadays, but it's definitely doable! Good luck!

      tag- Why don't most girls like programming?
    • Re:Beginner Book (Score:2, Informative)

      I learned most of my DHTML by playing with Dan Steinman's Dynamic Duo tutorial [dansteinman.com]. He doesn't really support Mozilla yet, but you can *generally* convert IE DHTML javascript into Mozilla pretty easily by using a couple ECMAScript methods instead of IE specific collections (like document.all). I got ramped up very quickly in a short amount of time using Dan's tutorial.

      -DG

  • by Pyrosz ( 469177 ) <amurray@@@stage11...ca> on Tuesday October 29, 2002 @10:27AM (#4555882) Homepage
    As I just stated, the first edition was a great book and it has never left my desk since the day I bought it. If your a serious web developer or just a part time page monkey, this book (the first or I guess now the second edition) is for you. Hard to go wrong buying an O'Reilly book.
    • >Hard to go wrong buying an O'Reilly book

      I dunno about that. A fair few of the corner case ORA books are pretty mediocre. Some of them are great -its these that create the reputation that other volumes just use, rather than expand.

      To be fair, the great:good:mediocre ratio for oreilly is better than most other publishers.
  • by Anonymous Coward on Tuesday October 29, 2002 @10:27AM (#4555883)
    ... no matter how good the book is (and it probably is, I'm not meaning to say it isn't), doing good html is really hard / complicated. A good book isn't going to automatically mean you master it - you need to practice like mad, read the source code for websites, create websites, have common sense, a decent understanding of the human-usability thing (not easy), and be prepared to do the tedious work that is typing out html once you've mastered the skill in the first place.
    • duh (Score:2, Insightful)

      by Anonymous Coward
      The same thing can be said about any book covering just about any language.
      • Most languages have a very rigid. Not to with DHTML.

        In DHTML there are seven different ways of doing everything. Five will work in IE. One will crash IE. Three will work in Nutscrape. Three will crash Nutscrape. There is an overlap of one.

        Finding that one is harder than a very hard thing that's been starched to make it harder.
    • by Anonymous Coward
      I think you are mixing up HTML with web design. It is easy to create a website but it is very difficult to design a good website. Any book on HTML or any other programming language isn't going to teach you esthetics and usability. It isn't their purpose. We have guys like Tufte, Nielsen, Krug, etc. to help with that.
    • by nick_davison ( 217681 ) on Tuesday October 29, 2002 @11:41AM (#4556463)
      Normally I'd agree with you but there's the argument that this book really is that good (I've been using the first edition as my [very nearly] exclusive reference for a couple of years now).

      One of the problems with the way most people used to learn HTML is that they picked apart other people's examples, trying to figure out how things worked, with no formal guide. The end result was most people knew a <p> tag worked fine on its own but had no understanding of what it was really doing, why you may want to use a </p> tag or any of the other issues.

      This book [1st ed. not 2nd - I'll admit, I've not seen the 2nd yet] works by giving a very clear introduction to the concepts and then simply laying out exactly the information you need, with a quick explanation and a short example.

      Can that replace all of the experience you'd gain through working? Of course not. But it really does save the time spent acquiring a vast amount of it: All of those additional parameters that you'd need to chance upon seeing somewhere else are laid out, giving you the inspiration; the complete specifications are laid out (so things like regexps that I'd never seen in JavaScript were covered; "pure" examples are given so you're not hacking apart an example hacked apart from someone else's hacked apart example; the clear layout and concise explanations mean you understand how everything fits together that much more easily, giving you a head start on the whole "common sense" side.

      So no, no one anything can give you a complete grounding: The perfect knowledge of HCI, the perfect knowledge of photoshop, the perfect knowledge of HTML structure and tags, none of those things alone make you a well balanced expert. But, for the price (~$45) and the speed (how quickly you can find exactly the information you're after in this well laid out book), it's a better (more efficient) investment than anything else I've come across.

      It really is that good.

    • I thought that's what Frontpage is for.

      Right?

      :P

  • DHTML standard? (Score:2, Interesting)

    by redtail1 ( 603986 )
    Nice review. I was Googling the web yesterday trying to figure out if any DHTML techniques have become standards. Can anyone point me to a site or two that answers this question? I have my heart set on not writing another line of code that won't work in one browser or another. Within reason.
    • Re:DHTML standard? (Score:5, Interesting)

      by larien ( 5608 ) on Tuesday October 29, 2002 @10:35AM (#4555940) Homepage Journal
      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.
      • 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

        Well, that's certainly a pretty low denominator! But let me ask you this. If you were commissioned to design a new 8-lane, divided highway, would you set the speed limit at 30 mph, to ensure that those who choose to drive around in Model T's can keep up with traffic?

        • Re:DHTML standard? (Score:3, Insightful)

          by ictatha ( 201773 )
          "If you were commissioned to design a new 8-lane, divided highway, would you set the speed limit at 30 mph, to ensure that those who choose to drive around in Model T's can keep up with traffic?"

          This isn't a very good analogy. When you go to a non-dhtml web page, are you dissapointed, or othwise negatively affected specifically because they aren't using DHTML? Your analogy states that everyone would be negatively affected by someone's choice not to use the latest and greatest.

          I will counter your analogy with another bad/wrong analogy:

          If you were commissioned to design a new 8-lane, divided highway, would you make all the road signs fly from one side of the road to the other? Would you have "Hit the Monkey and Win $20" interactive highway advertisements? Would you make drivers have to drive over a certain spot to see certain signs?

          It all depends. Most of the things in my bad analogy wouldn't be good ideas. It just depends on the audience, and what you are trying to convey. Not using the latest and greatest isn't a 100% sure sign that a site will be a bad experience. That depends on the skill and intent of the designers/programmers, not on the technology they use.

          • If you were commissioned to design a new 8-lane, divided highway, would you make all the road signs fly from one side of the road to the other? Would you have "Hit the Monkey and Win $20" interactive highway advertisements? Would you make drivers have to drive over a certain spot to see certain signs?

            Of course not, but I would have stoplights here and there that occassionally need to change, and possibly some railway crossings that need to flash, with gates that rise and fall, and ...

            Believe it or not, but dynamic content on the web is USEFUL when not abused.

          • This isn't a very good analogy. When you go to a non-dhtml web page, are you dissapointed, or othwise negatively affected specifically because they aren't using DHTML?

            Well, yeah, I'd really like the filtering and sorting and thread grouping and so forth to be client-side on slashdot. Never gonna happen, because it ain't DHTML. Screwdriver? Damn newfangled inventions, why can't people be happy with this here hammer. Works for me every time, good old hammer.
        • Re:DHTML standard? (Score:4, Insightful)

          by Anonvmous Coward ( 589068 ) on Tuesday October 29, 2002 @12:43PM (#4557069)
          "Well, that's certainly a pretty low denominator! But let me ask you this. If you were commissioned to design a new 8-lane, divided highway, would you set the speed limit at 30 mph, to ensure that those who choose to drive around in Model T's can keep up with traffic?"

          Arrrgh I'm sick of people arguing with metaphors! Feels like I'm watching an old episode of Star Trek!

          There are reasons to not rely 100% on the imagery of your site. For example: I went on a business trip, the modem connection was awful. I turned off images in Opera so that I could browse the web in a reasonable amount of time. The reason why that works is because most of the sites I went to had documented what each of the images are.

          It's a matter of accessibility, not speed. If you support blind people, for example, then your website doesn't suddely slow down to 30mph as your poorly chosen metaphor suggests.

    • Re:DHTML standard? (Score:2, Interesting)

      by KingAdrock ( 115014 )
      HTML and CSS are both standards and can be validated at the W3C [w3c.org]. As for Javascript I have the same question. It Javascript at all standardized? Does a Javascript validator exist anywhere?
    • by yerricde ( 125198 ) on Tuesday October 29, 2002 @10:38AM (#4555953) Homepage Journal

      figure out if any DHTML techniques have become standards.

      DHTML means manipulation of the HTML DOM [w3.org] through ECMAScript [www.ecma.ch]. The HTML DOM is a W3C Recommendation, and ECMAScript is a European international standard.

      • .. and both these standards are well supported, at least for normal use, by both IE, Mozilla and (I think) Opera. I think this as a very overlooked fact, by looking at all the trouble web designers are going through making special cases for the amounts of browser/version combinations.
    • Re:DHTML standard? (Score:4, Informative)

      by ism ( 180693 ) on Tuesday October 29, 2002 @10:52AM (#4556090)
      DHTML is dependant on two things: (1)browser ECMAScript compatibility and (2)the browser's DOM. ECMAScript Core is implemented 100% correctly as per the spec on most modern (version 5) browsers. The problem is the DOM. The Gecko and IE engines both support the W3C DOM spec but there are still some minor differences. DOM Level 2 is not yet 100% implemented on either browser engine afaik. The other problem is that HTML also depends on event bindings to the DOM. Mozilla implements the W3C DOM-Events model, and IE uses its own event model.

      Besides the major two browsers, Opera does in fact implement a great deal of DOM Level 1. I'm not up to date on Konqueror but last I checked it supported a good chunk of DOM Level 1. DHTML on Macs is relegated mostly to IE for Mac, but beware, it acts differently from IE for Win. You need to test them as two separate browsers. I haven't checked iCab lately, but last year it was beyond hope. There's also Chimera, a Gecko port, which should act the same as other Gecko engine browsers. Some people are still using Netscape 4 and you're stuck with a layers DOM there, totally different from any other DOM.

      So it really depends on what browsers you are targetting and what kind of things you want to do. DOM Level 1 is about as close a standard as you can get, but you're still going to have some browser-specific code.
  • I don't have the new edition (mine is the first edition, publiched July 1998), but I couldn't imagine being a developer of web-facing applications without this book. The JavaScript reference and the DOM references are great, and the CSS reference is really useful as well. I don't care much for the layer aspects of DHTML (behavior is inconsistent), but this book is still a great addition to any developer's library.
  • by Proudrooster ( 580120 ) on Tuesday October 29, 2002 @10:35AM (#4555936) Homepage
    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!
  • Over? (Score:3, Flamebait)

    by Jade E. 2 ( 313290 ) <[slashdot] [at] [perlstorm.net]> on Tuesday October 29, 2002 @10:41AM (#4555979) Homepage
    The browser war is over? Since when?

    Oh, that's right, you only have to design for IE now. Silly me, I forgot that all [mozilla.org] the [opera.com] other [broswer.org] browsers [sourceforge.net] are [w3.org] dead. [handspring.com] That, or maybe, they all render DHTML exactly the same now? (HAHAHA)

    (Well, maybe Lynx is dead, it's web page seems to be down...)

    • Re:Over? (Score:2, Interesting)

      by Anonymous Coward
      Yea because they amount to what percentage of users? If you have an average of 1000 hits a month on your lowly web page, are you really going to want to support anything else, especially if you don't really have the time to install 10 different browsers.

      While you're at it, you better make sure it works with Mozilla 1.0 and 1.1. You better also make sure it still works with Netscape 6 (6.x) and 7. Then how about Opera 5 and 6. Then there is also Konqueror.

      So I say make sure it works under IE 5+ and then do a quick check with the Mozilla 1.0. Then later make sure it works completely with Mozilla 1.0 and Netscape 6. Then start branching out.

      I use Linux and Konqueror every day. I also sometimes use Mozilla or Opera because some sites render differently or the browsers crash or hang on various web pages -- probably nsplugins shitty under *nix. But when I have to develop some web page or web application, I make sure it works with IE and do a run through with Mozilla 1.0. If I have time I start branching out.
    • Re:Over? (Score:3, Interesting)

      by P-Nuts ( 592605 )
      The browser war is over? Since when?

      The browser war is certainly not as bad as it once was. Increasing standards support makes it possible to design a site that uses only the subsets of CSS/HTML/whatever that all the major browsers use. You don't need to use the non-standard IE and Netscape extensions that were introduced during the browser war proper.

      Corrollary: If you design a site that works only using well-documented standards, such as the W3 ones, and it works on a selection of browsers, then anything it doesn't work quite right on only needs to improve its standards support.

    • Re:Over? (Score:2, Informative)

      by jbrownc1 ( 589652 )
      Looking at the cumulative weblogs for my site (8/2000-10/2002), 65% of the visits are from one version or another of IE. Netscape 4.0 seems to have a pretty high hit rate (5.5%), but I think that's me hitting it with Chimera all the time. The rest is kinda evenly spread out with old versions of Netscape, Googlebot, Gulliver, [unknown], and MSProxy.

      Looking at the most recent quarter, however, things are a bit more dire, with various flavors of IE accounting for 80% of the visits. Various flavors of Netscape account for only 9.8%, with Googlebot, Ask Jeeves, etc, taking up the rest.

      The war may not be over, but I wouldn't get too cocky about who's winning just yet.
    • nah, its "links" now. heh.

      (its all in the "heh" folks)
  • 10 Rating? (Score:2, Interesting)

    by BShive ( 573771 )

    I liked the 1st edition too, so I'm not suprised that the 2nd got such a rave rating, but 10? I would have liked to see more information on why it's better than the first edition. Not mentioning much in the way of accessibility is a big minus for me working on corporate sites since Section 508 compliance required.

    Amazon [amazon.com] has it cheaper ($41.97) then B&N by the way.

  • by dbaron ( 463913 ) on Tuesday October 29, 2002 @10:43AM (#4556003) Homepage

    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.)

    • by Anonymous Coward
      Are people *still* pushing DHTML? Any standard that incorporates client-side JavaScript sounds like a bad idea to me. Client-side JavaScript is a pain to implement and has high maintenance costs.

      You get plenty of bang for your buck with HTML or XHTML with CSS. If you need business rules, stick 'em on the server.

      And don't waste time learning JavaScript! Your time is better spent learning PHP, Java, Python, you name it. You can't use JavaScript anywhere else.

      -Ed
      • by jwinter1 ( 147688 ) on Tuesday October 29, 2002 @11:11AM (#4556236) Homepage
        Hey, I agree with you, right up until you say that:
        You can't use JavaScript anywhere else.
        Mozilla's application interface uses JavaScript extensively and seems to be a very cool way to get cross-platform compatibility. But I hate JavaScript in web pages too.

      • by Anonymous Coward
        This is the sound of someone sorting a list of items without client-side javascript...

        click (wait)... click (wait)... click(wait)...

        One example of thousands of times where client-side scripting is useful. Is server-side scripting more useful? Certainly. Should server-side scripting be learned first? Probably. But any web developer that isn't familiar with client-side scripting is a mediocre web developer.
      • Javascript is a language, and there is even a stand-alone implimentation. Javascript is embedded in other programs, it's just not popular for other uses.

        I think it is/was also used for server-side stuff in netscape's webserver
  • by CodeShark ( 17400 ) <ellsworthpc AT yahoo DOT com> on Tuesday October 29, 2002 @10:48AM (#4556046) Homepage
    Although I don't have the 2nd edition yet, let me add a recommendation for anyone looking to learn or improve their coding and browswer scripting capabilities: Danny Goodman [dannyg.com] is one of the two authors whose books and sites are my "backbone" and reference points for all things Javascript and HTML/DHTML, the other being Laura Lemay [lne.com]. [Note: be nice to Laura and don't drop the /. effect on her web site -- copy the link or wait a bit and look it up later when the ravening /. hordes have moved on.]

    Other authors may do more for back end programming in your specific back end platforms and tools of choice, but you won't do much better than these two for front end browser programming.

  • DHTML in Mozilla? (Score:3, Interesting)

    by ceswiedler ( 165311 ) <chris@swiedler.org> on Tuesday October 29, 2002 @10:54AM (#4556105)
    I'm not a web developer, but I've heard that DHTML support in Mozilla is pretty bad. There are a few sites which either don't work at all in Mozilla, or have "static" versions with DHTML removed*. Some of the web developers around my office have complained about this, and cite IE's DHTML support as the best.

    Is this an issue of actual support, or just "IE standards" where people don't want to use real standards, just whatever "standard" Microsoft supports?

    * The site I'm thinking of is Citibank's credit card management section. here [citibank.com]. Of course, if you don't have a card with them, you can't log in to check it out.
    • by veddermatic ( 143964 ) on Tuesday October 29, 2002 @10:59AM (#4556133) Homepage
      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 _____."

    • Re:DHTML in Mozilla? (Score:2, Informative)

      by xutopia ( 469129 )

      I develop DHTML applications for a living (never read a book by Goodman either lol) and I find Mozilla to actually be superior to IE when it comes to DHTML.

      The problem is that many people use the DOM that Internet explorer has or mixes up old Netscape 4 DOM in Netscape 6/Mozilla instead of the standard set by the W3C. Try putting a honda key in a ford see if that works.

      Truth is if you stick to w3c standards Internet Explorer gives you headaches.

    • by Jugalator ( 259273 ) on Tuesday October 29, 2002 @11:19AM (#4556306) Journal
      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.
      • frm.USERNAME ... vs: document.getElementById("USERNAME") ... gee wiz, can I have MORE functions to be required to use, with no apparent benefit?

        Plus, your example is simply wrong. getElementByID scans the "id" attribute, not the name attribute, the latter being a necessary part of a form element. There's often multiple forms on a page that have elements with the same name (search forms with multiple search methods, for example). Basically, you need XPath to return a useful node with minimal syntax for scanning, and while I love the hell out of xpath, it isn't well supported because it's brand spanking new in DOM.

        So you want people to use more syntax with less functionality to do the exact same thing. Huh.
        • So you want people to use more syntax with less functionality to do the exact same thing. Huh.

          Whether or not it makes sense to you, it's the W3C standard, so I'd say you should hold your nose and follow it.


      • <model>
        <instance>
        <login>
        <username/>
        <password/>
        </login>
        </instance>
        <bind nodeset="username" required="true()"/>
        <bind nodeset="password" require="true()"/>
        </model>

        <input ref="username">
        <label>Username</label>
        </input >
        <secret ref="password">
        <label>Password</label>
        </secret>

        See http://www.w3.org/MarkUp/forms [w3.org] -- and there's already an IE plugin that does it.



  • by veddermatic ( 143964 ) on Tuesday October 29, 2002 @10:56AM (#4556118) Homepage
    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.

    • TROLL?

      Funny, sure, Informative, really... why muck around with the various browser compatability issues when even Netscape 4 supports the same Flash plugin that Opera/IE/Mozilla/You Name It supports??

      Maybe Danny himself modded me down to boost sales =)
  • Complexity (Score:5, Insightful)

    by Anonymous Coward on Tuesday October 29, 2002 @10:56AM (#4556123)
    "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.
    • Sounds like you should just write a client then. DHTML misses the whole point of using a web interface in the first place -- all clients being able to use the web. None of my pages depend on DHTML, but they may use it here and there, but it is never a requirement just to use the fscking site. It really pisses me off that places like the Pennsylvania government, of all entities, rely on client-side processing or don't work at all.
    • Uhh, try again. It's no where near as complex as conventional software engineering. Although I guess a case can be made for that argument since you aren't using any real languages. Re-write gcc, or the Linux kernel, or do real network programming, these are all conventional software engineering tasks. Web Programming is a misnomer. Web scripting is about all it really is. HTML is NOT a programming language, it is a markup language. JavaScript is NOT a programming language, it is a scripting language.

  • by elliotj ( 519297 ) <slashdot AT elliotjohnson DOT com> on Tuesday October 29, 2002 @10:57AM (#4556126) Homepage
    I'm not trying to troll here, this is an actual question because I don't know.

    Is DHTML still as relevant as it used to be? Aren't people using server side scripting (perl, php, asp, etc) for truly interactive sites and things like DHTML are little more than nice HTML enhancements for doing the odd neat thing?

    I just wondered what the perception was? I'm not anti-DHTML by any means, I'm just interested in where the general trend of web development is going.
    • by xutopia ( 469129 ) on Tuesday October 29, 2002 @11:15AM (#4556262) Homepage

      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! :)

    • by ShieldW0lf ( 601553 ) on Tuesday October 29, 2002 @11:24AM (#4556340) Journal
      DHTML is particularly relevant, in my experience, with generating dynamic forms.

      As an example, I've recently created a page that allows the creation of price structures. Price structures have a start date, an end date (which may be null), 0 or more surcharges (name and $)and 1 or more price breaks (min qty, max qty, unit cost). Also, each price break may have 0 or more surcharges (name and $)

      Building this with static HTML and server side scripting could require many trips back and forth to the server... this isn't very good from a users perspective.

      Instead, I used dynamic HTML to do it all in one page... the form is created on the fly, and modal dialogs are used when entering data to keep the interface clean. Clicking a button to add a price break opens a modal, fetches the details back from the modal, creates another table row, fills it with text showing what you've added, hidden input fields holding the data, an "add surcharge" button, and a "remove" button that deletes the table row (along with the hidden inputs it contains)

      You can easily add, edit and remove as many items from this form as you wish, and once you've tweaked the price structure the way you want it, the server breaks it all down and salts it away in the database.

      The whole thing is very usable, reusable, and efficient, and could not have been made without DHTML and JavaScript.
  • If I can't see a site without scripting enabled, I am not going to look at that site. Period.

    I use IE6 to cruise the web. Given the all the security holes and patches, I'll be damned if I say yes to "Scripts are usually hamless. Ok to run?"

    Even a site like the NYtimes runs under lockdown on my machine. Though I trust the web designers at the Times not to be malicious, I don't think they can secure their site against an attack that sneaks a malicious script onto their site. Same thing is true of internal web pages.

    • by a3d0a3m ( 306585 ) on Tuesday October 29, 2002 @11:56AM (#4556574) Homepage
      Do you also cross the street with knee pads, wrist guards, and a crash helmet?

      adam
    • If I can't see a site without scripting enabled, I am not going to look at that site. Period.

      Wow, well it's good to see that you're very progressive and open-minded. Why don't you try broadening your scope a bit? Sure, no one needs Java, Javascript, Flash, CSS, or DHTML to punch up a few news stories or your resume. But what about sites that let you dynamically monitor distributed processes? Or how about a little thing you've obviously never heard of called "e-commerce?" There are plenty of real, useful ways in which scripting makes things a lot easier, both for the visitor and the author.

      It says a lot that you couldn't see that. Period.

      • Why don't you try broadening your scope a bit?

        Well I used to run with all the bells and whistles enabled. Unfortunately, I stumbled across a website whose author was more interested in causing havoc on my machine than in providing content.

        It's true that well-intentioned scripting features can make things easier. It's also true that, in the wrong hands, those features can cause havoc. To me, it's not worth it.

        As to your last comment, E-commerce doesn't require DHTML, Flash, CSS, java or javascript. In fact, if you ever read the W3 specs, they make a point of saying that web sites shouldn't require any of those technologies to function properly. If you want animated pictures of butterfly-costumed men obscuring your screen, be my guest. Just don't insist that I watch them too.

      • But what about sites that let you dynamically monitor distributed processes?

        What do application-specific used-by-ten-people websites have to do with the WWW? The WWW is intended to be public and accessible, just like the public library or a local department store. Would you go to a store that denied you access because of the brand of shoes you happend to be wearing (even though shoes are a standard interface used in moving about the store)? What if you need to use an elevator but the only way to the second floor is a spinning neon escalator?

        Or how about a little thing you've obviously never heard of called "e-commerce?"

        The absolute best e-commerce sites are very light on DHTML. They follow a "Just the facts, Mam" philosophy of well-organized data entry (forms) and an intuitive work flow from beginning to end. They don't need DHTML for efficiently browsing catalogs, nor do they need DHTML for data entry, nor do they need DHTML for actually performing the transaction.
    • I use IE6 to cruise the web. Given the all the security holes and patches, I'll be damned if I say yes to "Scripts are usually hamless. Ok to run?"

      Maybe you should try using a browser that doesn't have so many security problems. I suppose if the lock on your door was easy to pick then you would get rid of your possessions rather then getting a better lock.

      The scripts are not the problem. IE is the problem.
  • First of all, what is DHTML? Why not just call it "Scripting CSS and DOM with ECMAScript"? Calling it DHTML is confusing, because it makes it sound like a seperate version of HTML.

    Honest question: there seems to be a lot of overlap between this book and other O'Reilly titles. Can anyone tell me why I would want this one rather than "HTML/XHTML, The Definitive Reference" and/or "Javascript, the Definitve Reference"?
  • Then the first one wasn't THAT definitive!!
  • Dynamic Duo (Score:4, Informative)

    by Bio ( 18940 ) on Tuesday October 29, 2002 @11:19AM (#4556310) Homepage Journal

    I'm not so up to date what's the current state of the art, but some years ago, when I was applying DHTML, I always found Dan Steinman's Tutorial Dynamic Duo [dansteinman.com] very helpful (thanks Dan!).

    It has been continued as DynAPI [sourceforge.net]

    • Re:Dynamic Duo (Score:4, Insightful)

      by Jugalator ( 259273 ) on Tuesday October 29, 2002 @11:55AM (#4556569) Journal
      Too bad that the Dynamic Duo site teach to write special cases for IE4/NS4. What about Mozilla and any Netscape version past 6.0 that has nothing in common with Netscape 4? What about Opera?

      Then they have to suggest using something like this:
      if (ie4) {
      // IE4+ code
      } else if (ns4) {
      // NS4 code
      } else if (ns6) {
      // NS6/Moz code
      } else if (opera) {
      // Opera code
      }
      Can you see the maintenance you'd need to do to make it cross-browser compatible?

      The alternative is DOM where you can use common code for all browsers that support DOM. Considering that the standard has been around for years and is supported rather good by all current browsers, it's surprising that there's enormous amounts of sites around that teach the aging "version 4" coding philosophy. It's the philosophy behind those hideous IE-specific pages that might have *some* Netscape support in but break when you use a browser/browser version the coder didn't expect or didn't exist at the time the page was coded.
  • Against JavaScript (Score:2, Interesting)

    by Animats ( 122034 )
    As web firewalls become more pervasive, in response to more obnoxious JavaScript, more and more JavaScript dreck will be blocked. So pages must again work with JavaScript off. In particular, make sure you can buy using your e-commerce sites with JavaScript off or blocked by a proxy. Never assume your page can force a window to open on the client.

    If you want eye candy, use Flash, which does a much better job of it.


  • Anyone own both? How do they compare to one another?
  • I got this book the day it came out. I've been waiting a few years for it, and I haven't been disappointed.

    The reason I like the book so much is because it's not soley limited to DHTML. The first couple hundred pages talk about DHTML and it's uses in browsers, etc. All very great writing, but stuff I already know.

    The great part about the book is the other 1000+ pages of syntax references for everything, HTML, JS, CSS, DOM, everything. Basically it's a book that tells you everything you can possibly do in a browser, not just DHTML.

    I've used it for looking up CSS properties, or HTML attributes, or Javascript functions. I don't know how many times I've thought of and idea of something to do in a browser, looked in the book, and found some method to do it. Sure beats trying to find info on the W3C site.

    Best book I've ever owned, bar none.
  • Without a doubt, the first edition of this book is the best web book I've owned. I use it regularly to check myself on unmemorized topics, and lend it out to friends that find themselves in the same boat.

    It's a great combination of HTML/Javascript/DHTML/CSS etc.

    Well worth the money.

Whatever is not nailed down is mine. Whatever I can pry up is not nailed down. -- Collis P. Huntingdon, railroad tycoon

Working...