Pascal wrote:
> 
>> i'm seeing a new, related problem that thought i should bring to your
>> attention. this occurs in rev. 522 and 524.
>>
>> I'm calling $(form.elements).customPluginThatIWrote().
>>
>> as a test, before this statement, i alert(form.elements.length),
>> getting a value of 16 (the # of elements in this particular form).
>> then in my custom plugin, i have alert(this.size()). in Firefox and
>> Safari this also returns 16, but in IE6 the value is 1 for some reason.
> 

It looks like the probem is in the jQuery constructor:

this.get( a.constructor == Array || a.length && !a.nodeType && a[0] !=
undefined && a[0].nodeType ?

Since form.elements is a NodeList, it shouldn't have a nodeType; only
DOMElements should have nodeType. But IE's form.elements NodeList has a
nodeType=1, .nodeName="FORM" and its own .childNodes NodeList that returns
the same thing as form.childNodes. IE seems to have combined the
form.elements NodeList with the form node itself!

Another bug hiding there: If an empty NodeList is passed in (with any
browser), it will fail the a.length test and send it to jQuery.find which
doesn't know what to do with it. That part of the fix should be easy,
a.length!=undefined . It's the IE workaround that has me stumped.


-- 
View this message in context: 
http://www.nabble.com/%24%28form.elements%29-fails-in-Safari-tf2544245.html#a7181688
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to