foo = function () { } foo.prototype = { doAjax: function () { that = this; ajaxThing(function () { that.ajaxCallback(); }); }, ajaxCallback: function () { /* blah */ } }