On Mar 31, 7:32 pm, Roland <[EMAIL PROTECTED]> wrote:
> Here's some snippet code i use in my script:
>
> target.writeAttribute('class', '').update('');

I expect it is because you are not adding Prototype.js's extra methods
to the object that is target.  Presumably it is a DOM object, so
before the above line initialise target as:

  var target = $(this.content);


> if(Object.isString(this.opt.className))
> target.addClassName(this.opt.className);

Why test if opt's className is a string - can it possibly be any other
type?  Consider just adding it, and since target either doesn't have a
className or you've changed it to an empty string, all three lines can
be replaced by:

  target.className = this.opt.className;


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to