Can someone explain why the following code does not work? The function
f prints "this" as an "object" but the function g will print it as the
current window. I thought the call to bindMethods would fix the this
pointer???
function c() {
this.f = f;
function f() {
log('f', this); // print [object Object]
g();
}
function g() {
log('g', this); // prints [object Window]
}
bindMethods(this);
}
inst = new c();
connect(currentWindow(), 'onload', inst, inst.f);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---