Monday, October 23rd, 2006

So You Wanna Be a DOM Star

Category: The Ajax Experience, Unobtrusive JS

Aaron Gustafson started several Ajax Experience atendees off on a great note with his presentation entitled ‘So You Wanna Be a DOM Star’. Gustafson stressed a very proactive and pragmatic approach to JavaScript development. His key suggestions included:

  • Understand what your script is attempting to accomplish, and then script your scripts (in other words, don’t be afraid to psuedocode)
  • Understand what the JS libraries are doing for you, otherwise you won’t know where to start when things go wrong
  • Use Ajax appropriately with the user experience in mind – avoid the temptation to use it for the sake of showing off
  • Set intervals (probably quarterly or semi-annually) to review the scripts you have written, and think about what you would have done differently
  • Read the documentation AND source code of the libraries you use

Aaron also stressed unobtrusive JS. Scripts should detect if methods and objects exist before attempting to access them. Testing and tracing tools should be used early and often…and make sure you manage memory leaks.

Aaron suggested that an unobtrusive Ajax application can be thought of in layers. The application should start with a baseline user experience that can be conveyed in old browsers and when JavaScript is disabled. From there, features can be added to the user experience in an iterative manner based upon the capabilities of the user’s browser.

These ideas offer some great support to the notion that JavaScript development needs to be treated as “real” development in our Ajax applications.

Posted by Tom Geer at 6:49 pm
Comment here

+++--
3.7 rating from 32 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.