When I use JS on a website, I often like to split up the code into logical, complete modules using function(), usually like so:
function BigClass() {
this.doOneThing = function() {
}
this.doAnother = function() {
}
}
Later I use jQuery's .ready() to create instances of the classes I'm using and hang those onto various events.
var bigClassInstance = new BigClass();
$('a.something').click(bigClassInstance.doOneThing);
My question is... what's the best way to do execute the doAnotherThing() function from my call to doOneThing()? Working on smaller projects, I'll just use bigClassInstance.doAnotherThing();, but that's not portable.
What's the Right Way to go about doing this?