yes, in handler functions scope is usually lost
you can fight it this way:
onComplete: function() { this.ReadResponse(); }.bind(this)

>
> Ok, could someoe explain, I'm losing scope for "this", see below the
> line this.ReadResponse();
>
> This has no scope.  Why?  What does work is the next line, where _PG
> is the defined object of this class.
>
> var PageContent = Class.create({
> ....
>
>     Read: function(id)
>     {
>         var layer = 'content_edit_layer';
>         var pars = 'ax=read_content&PageContentID=' + id;
>
>         var myAjax = new Ajax.Updater(
>         layer,
>         this.ajax_updater_url,
>         {
>             method: 'POST',
>             parameters: pars,
>             onComplete: function() { this.ReadResponse(); }
>             //onComplete: function() { _PG.ReadResponse(); }
>         });
>     },
>
>     ReadResponse: function()
>     {
>         new Effect.BlindDown('content_edit_layer');
>     },
> >



-- 
arty ( http://arty.name )

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to