Christian Heilmann

You are currently browsing the Christian Heilmann blog archives for March, 2006.

Archive for March, 2006

New free article – From DHTML to DOM scripting

Wednesday, March 29th, 2006

I just published a new longer article (40 pages) trying to explain the differences between DHTML and DOM scripting. The article explains what DHTML, the DOM and DOM scripting is and shows how to create a web page with dynamic elements like tabs, a slide show and a big product shot in both ways.

The DHTML explanation is annotated with explanations why some of the techniques are a bad idea and the DOM scripting version explains why some of the assets are good ideas. As a summary:

DHTML issues:

  1. Script dependence – Users without JavaScript get stuck or get elements that only work with JavaScript but don’t do anything for them.
  2. Mixing presentation and functionality – If you want to change the look of the effect you need to hack around the JavaScript.
  3. Assuming functionality without testing for it – what it says
  4. Keeping maintenance JavaScript based – Maintainers are expected to change the script when they want to change the effect, and search through the whole script.
  5. Mixing HTML and JavaScript – what it says
  6. Blaming the user – Users get messages like “you cannot use this as your browser doesn’t support it, update your browser” instead of just not getting the functionality if it is not 100% necessary.
  7. Taking over the document – one onload to rule them all

DOM scripting assets:

  1. Progressive Enhancement – check if things are available, then apply those dependent on them
  2. Ease of maintenance – keep the maintenance as easy as possible via dynamic CSS classes and properties at the beginning of the script
  3. Separation of Presentation and Behaviour – add dynamic classes instead of changing the style collection
  4. Separation of Structure and Behaviour – use dynamic event handlers and generated elements instead of onclick and NOSCRIPT
  5. Using modern event handling – more than one onload please
  6. Avoiding clashes with other scripts – avoid global variables and encapsulate functions as methods in an object

Of course, you can disagree :-)

Return of the dreaded DHTML news scroller

Thursday, March 23rd, 2006

help needed Apparently this thing is not as neat as I thought it was as it slows down Safari and Firefox on Mac enormously. As I don’t have the time to fix it right now (book writing), I invite you to have a go at it and clean it up. I will publish the fixed version with full credits here. I am not proud of this thing, I hate those scrollers.

Sometimes it is amazing how a bad idea from the past keeps popping up in different spots at the same time.
Some of you might remember when DHTML was at its prime, that every web site needed a news upscroller, marquee or other scroller. For some reason, clients love these things and many a developer started a script loaded with features and merrily mixing HTML, JavaScript and CSS to support even the most pitiful browsers out there. The DHTML Junkyards are still full of scripts hailing from that time.

This morning somebody on CSS-D asked for a table-less news upscroller in CSS, which of course is impossible, but just as I sighed and wondered who still wants those, one of our clients demanded one as well. Well, their development team agreed to implement one and wanted advice how to do one and still only use valid HTML and be accessible.

The accessibility of it is an issue, as are a lot of other things. However, I did an example and for the sake of it vented off some steam on the demo page.
Enjoy DOMnews, the DOM compliant, stop-able gracefully degrading DHTML news upscroller.

How would you like to be me? Looking for a Lead Information Architect

Wednesday, March 22nd, 2006

I finally got the go-ahead to look for a replacement for me in the company I am still working for. I am leaving here on the 14th of April, and will join Yahoo on the 24th.

So, if you are:

  • A very web standards and quality orientated Interaction Architect
  • A good team leader
  • Experienced in various development Frameworks (.NET,Spring,PHP)
  • Fully up to speed on Accessibility regulations and development practices
  • Experienced in conducting Usability Testing
  • Interested to work in the South West of London / England

Drop me a line and your CV at the new yes.i.want.to.be.chris@googlemail.com email.

I will treat your CV with confidentiality and cannot promise anything. However, I do think I can find a better bunch of CVs here than our HR department can get through agencies :-)

My book on Amazon – no pressure then

Monday, March 20th, 2006

Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional I was just mildly shocked that my book is already on Amazon.com while I am still writing chapter 6 of 9!

So I guess it is time to cut down on the posting here and other things like bathing, eating and sleeping to ensure I get it ready in time to beat the next Harry Potter in the sales ranks (or something like that).

Minislides – inline slide shows with DOM and CSS

Friday, March 17th, 2006

As part of my book, I am right now writing the “common uses of JavaScript” Chapter, and this morning a request by Michel Bozgounov on the CSS-d list tickled my fancy.

He wanted an easy way to show slightly larger images when clicking on very small thumbs inside a page. While his solution would force visitors to load all the images (including the large ones), I quickly put together a solution that only loads the larger images in the same list when JS is available.

This is only a beta and a freebie. The full version with explanations is part of the book and I cannot give it out (yet) as it will be part of the whole copyright and all that Jazz.

Enjoy, and hopefully you find it useful.