I think $A() only converts an array to a Enumerable... not a single
object...
try $A([element]) ... this should work
hth
On 3/28/06, Daniel Herrero
<herrerodani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Thank you Ryah! With your answer I have been able to integrate Behaviour
> into a Prototype class. Thank you again!!
>
> Now I have a question related to prototype. It doesn´t transform single
> elements to an array?
> I have this code:
> var element = $("idDiv");
> var array = $A(element);
> alert(array.length);
>
> the output is 0;
>
> with this one:
> var elements = $("idDiv", "idDiv2");
> var array = $A(elements);
> alert(array.length);
>
> the output is 2;
>
> What am I doing incorrectly? this is a feature or an error?
>
> --
> Daniel Herrero Dávila
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
--
Mit freundlichen Grüßen
Siegfried Puchbauer
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs