Hi all
I have written a class using prototype Class object
and after playing it for a while, I saw that I need to use the "with"
keyword in the class members,
so I can access its members

here is the relevant part of the class : (the member is "_div")

var JSClass = Class.create ({
     initialize: function(initParams) {

        if (initParams.div)
        {
            *this*._div = $(initParams.div);
        }
        else
        {
            *this*._div = new Element(div);
        }
     },
     // an example of a member function
    setComment: function(msg)
    {
        *with(this)*
*        {*
*              *_div.innerHTML = msg;
*        }*
    }
});

is there a way that I can get rid of all these usages of "this"

Thanks
Ran

-- 
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-scriptacul...@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