var that = this; Keeping a class in scope of nested functions I've been using this syntax alot recently to keep my class in scope of nested functions. It seems to work well in small to moderately sized class but I'm starting to wonder how efficient it actually is and if there is a better way to handle this. Any suggestions would be really useful.

myClass.prototype.myMethod = function() {
    var that = this; // Without taking the size of the class into consideration 
                     // does this create an unecessarily high load?
    function callback_one(data) {
        that.myOtherMethod();
    }

    function callback_two(data) {
        that.myErrorMethod();
    }

    $.post(this.getRequest(), this.getUrl())
        .success(function(data) {
            callback_one(data);
            // Can also use that.anotherMethod() here
        })
        .error(function(data) {
            callback_two(data);
            // Can also use that.anotherMethod() here
        });
}
Your code is fine (assuming your nested functions are merely proxies to the class methods), I would suggest if the only thing you are doing in the anonymous functions is calling the callbacks then you should just pass them in:
$.post(this.getRequest(), this.getUrl()).success(callback_one).error(callback_two);

There is nothing wrong with the use of that in this code.
Edit (after reading Esailija's answer)
You could also do the proxies mentioned in the Esailija's answer inline like so:
myClass.prototype.myMethod = function () {
    $.post(this.getRequest(), this.getUrl())
        .success($.proxy(this.myOtherMethod, this))
        .error($.proxy(this.myErrorMethod, this));
}

Essentially that is what you were doing with the nested functions; this just tightens the code by moving the proxy creation into a utility method.