> Such nodeLists are kind of arrays, but immutable. 
> I don't know what jQuery does to an array like 
> element passed to $(). If its trying to alter the 
> passed in array that won't work...

It's supposed to treat any array-like thing as a collection of DOM nodes,
and to paraphrase those villians on Scooby Doo it would have gotten away
with it if it wasn't for that pesky Safari. It doesn't change the incoming
arguments in any way, it just copies them to a real Array.

> To verify this one could try:
> 
> var elems = [];
> for (var i = 0; i < theForm.elements.length; i++)
>      elems.push(theForm.elements[i]);
> 
> alert( $(elems) );

That should work fine, if it behaves like it did a week ago with a similar
problem. It looks like Safari had a digestive problem with expression
!theForm.elements.nodeType,  although it did understand that nodeType was
undefined according to the error message it gave.


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

Reply via email to