Rule Zero for writing a JavaScript Widget

Published by Rob on July 17th, 2010 - in Miscellaneous

If you are adding ID’s you are doing something wrong.

This will cause issues for people who want to have multiple copies of the widget in
the page.  There is to much risk of ID collision.

There is always a way of navigating down the tree to find children (Especially if you
are writing a JQueryUI widget).

Classes are ok – and use them to find children – but DO NOT add an ID.

(This blog post written as a public service, after having seen way to many JQueryUI widgets that don’t get this right).

Related posts:

  1. Dynamic Tree Widget
  2. Writing Test Driven Swing ñ my plan
  3. Setting up Oracle XE to work with IBM WebSphere Portal IWWCM

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Rob@Rojotek