Hello,
I'm trying to create a JS class and I'm having some trouble with the
function scope. I have a function within one of the class methods
that is trying to call another class method, but I'm not sure the
right way to call it. Here is an example:
var Foo = Class.create();
Foo.prototype = {
initialize: function(params) {
alert('you just created an object, good
work.');
},
functionA: function (){
functionAA();
function functionAA(){
this.functionB();
//this.functionB.bind(this);-
also didn't work
}
},
functionB: function (){
alert('function b');
}
}
Event.observe(window, 'load', function() {
var bar = new Foo();
bar.functionA();
});
Any help would be appreciated!
Thanks,
--Chris
--~--~---------~--~----~------------~-------~--~----~
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 [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
-~----------~----~----~----~------~----~------~--~---