Element#readAttribute is meant to work the way the native
Element#getAttribute _ought_ to. The DOM spec says getAttribute should
always return the string value of the attribute. IE(<= 7) incorrectly
maps HTML attributes to DOM properties, such that
node.getAttribute('disabled') === node.disabled.

In other words: if you want the boolean, you've already got the JS
property. Element#readAttribute aims for the consistent behavior
across browsers that getAttribute lacks.

Cheers,
Andrew

On May 7, 3:45 am, RobG <[EMAIL PROTECTED]> wrote:
> On May 7, 2:43 pm, jdalton <[EMAIL PROTECTED]> wrote:
>
> > I have patched Prototype to give the desired consistent result of
> > "disabled".
>
> I didn't request that, nor do I consider it the desired result.
>
> The disabled attribute is a boolean, therefore any function that
> returns its value should also return a boolean.  All that is required
> is to get the value of the DOM element's disabled property directly
> and if the result is anything other than boolean true, return false.
>
> --
> 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 [email protected]
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