Thx, Gareth. I already found solution. Other possible solution is:
with(this) { ... }
On Mar 17, 8:58 am, "Gareth Evans" <[EMAIL PROTECTED]> wrote:
> Sorry i put the definition for self in the wrong place
>
> Foo = Class.create();
> Foo.prototype = {
> initialize: function() {
> var self = this;
> var array = $A([1, 2, 3]);
> array.each(function (i) {
> self.hello();
> });
> },
>
> hello: function() {
> alert('hello');
> }
>
> }
>
> On 3/17/07, Gareth Evans <[EMAIL PROTECTED]> wrote:
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---