Stephan Beal wrote:
On Jul 12, 12:00 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
    * You can use jQuery to create elements, eg. $("<" +
      props.elementType +
      ">").addClass(props.elementClass).css('background-color', color)
      <- chaining, too

i think i found a jQ bug (or "unexpected, undocumented behaviour", if
you prefer) here:

var elem = jQuery('<'+props.blotchElemType+'>')
        .addClass( props.blotchClass )
        .css( 'background-color',color) // chaining here fails if color is
null???
The trouble here is the mix of setters and getters. Provide the second argument and its a setter, leave it, and its a getter. In this case you have to make sure that no null or undefined is passed as the second argument, or you have to put that one on its own line.

jQuery maybe should check the number of arguments to prevent that problem.

--
Jörn Zaefferer

http://bassistance.de

Reply via email to