Fred wrote:

> Christophe Porteneuve wrote:
[...]
> > Just another consequence of IE's shabby DOM implementation and standards
> > compliance.
>
> I think it's fair to call it a bad idea as it has some unexpected
> consequences, but it is entirely due to IE's implementation of the DOM
> and the way it resolves identifiers, it has nothing to do with (W3C)
> standards compliance /per se/.

That may need a little more explanation: IE does not distinguish
between ID and name attributes when using getElementById, it treats
them all as IDs.  Given:

  <div><input name="sally"></div>
  <div id="sally"></div>


Then in IE, document.getElementById('sally') will return a reference to
the input, not the div.

[...]
> document.getElementsByClassName = function(className, parentElement) {
>   if (typeof parentElement == 'string'){
>     parentElement = document.getElementById(parentElement);
>   } else if (typeof parentElement != 'object' ||
>              typeof parentElement.tagName != 'string'){
>     parentElement = document.body;
>   }
[...]
> If the initial identifier resolution is put into the $() function,
> prototype will benefit in general.

No, it wont.


-- 
Fred


--~--~---------~--~----~------------~-------~--~----~
 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