[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread ronman
It works! Thank you muchly. Valuable for learning, too. Now the code executes far enough to uncover another similar problem which I think will go to my basic understanding of Javascript. I'm expecting it to act like PHP but I keep getting functions where I expect values: given: attr: {

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread Rick Waldron
attr.edges is an array... keep it simple :) http://jsbin.com/unohi I just added to the last example, so view the source Rick On Sat, Jul 11, 2009 at 10:54 AM, ronman ron.new...@gmail.com wrote: It works! Thank you muchly. Valuable for learning, too. Now the code executes far enough

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread ronman
Using an array works when it's empty, but unfortunately normally attr.edges is filled with rather complex objects. (I wanted to print one of the objects out for you but can't get Object.inspect(attr.edges) to show anything but [object Object] . Seems like javascript never wants to do what I

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread ronman
Actually, more to the point, what I tried to do originally was detect an empty Hash and not go through each() at all in that case. But attr.edges.size() comes back as 32, not zero. alert(attr.edges.size) shows the source for the iterating function, as I said before, so apparently size() gives

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-10 Thread Rick Waldron
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.