The result your getting is completely correct, you're just missing one
aspect...
Take a look:

http://jsbin.com/anefa


(view source... )


On Fri, Jul 10, 2009 at 4:57 PM, ronman <ron.new...@gmail.com> wrote:

>
> Hi,
> I've been puzzling over this for a couple of days and finally admit I
> need help.  I have a Hash of objects which I iterate over using each:
>
>  $H(data.nodes).each(function(mynode,id) {
>      alert(mynode);
>      // do something with mynode
>    },this);
>
>
> What I get back for 'mynode' is
> 'nodename', [object Object]
>
>
> instead of what I need:
> [object Object]
>
>
> Here's the structure of the Hash, copied from Firebug.  If there's a
> better way to represent this, let me know:
>
> data:      Object nodes=Object size=[2]
>  nodes:   Object node0=Object node1=Object
>    node0:   Object label='node 0' height=0.44
>    node1:   Object label='node 1' height=0.44
>    node2:   Object label='node 2' height=0.44 width=1
>    node3:   Object label='node 3' height=0.44 width=1
> .
> apparently the _each method of Hash in Prototype can't understand this
> structure, but I'm not seeing why it returns
> 'nodename' and a comma before the object instead of just the object.
>
> Help!
>
> Ron
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to