Why does this work:
var Deletr = Class.create({
        initialize: function(options) {
                var list = new Array();
                $$('a.deletr').each(function(element) {
                        list.push(element);
                });
        }
});

But this does not?
var Deletr = Class.create({
        initialize: function(options) {
                this.list = new Array();
                $$('a.deletr').each(function(element) {
                        this.list.push(element);
                });
        }
});

Firebug reports:
this.list is undefined
this.list.push(element);

Is there a way to access class attributes when I'm using each to
iterate over an array?
That would be really helpful!

Thanks
David
--~--~---------~--~----~------------~-------~--~----~
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