[Prototype-core] Lost scope this in class method Ajax onComplete event

2007-12-16 Thread kstubs
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 =

[Prototype-core] Re: Lost scope this in class method Ajax onComplete event

2007-12-16 Thread Artemy Tregoubenko
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