понедельник, 7 января 2013 г., 20:59:28 UTC+2 пользователь mikhail написал:
>
> No, this method `msg` is public.
>
> But if you create
>
> var myClass= Class.create(
> { initialize:function(str)
> { this.str=str ;
> msg=function()
> {alert ("privat"+this.str);}
> } ,
> public:function()
> {alert ("public"+this.str)}
> }
> )
>
> then `msg` is private. All method that your add to `this` will be public.
> For creating private methods use that was advised or agreements (for
> example: all private methods started with __ -> __private_method,
> public_method).
> но в таком случае msg получается глобальной...это не совсем
> хорошо..правда??
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/-n1ZbMSiAi8J.
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/prototype-scriptaculous?hl=en.