You don't want to change the argument to your success handler. That first argument to the success handler is your ajax response data so you need to treat it as such.
To get access to the this
pointer in your success handler, there are several methods. The one I think is the most elegant is that jQuery allows you to pass in the context that you want this
to be set to in your success callback as one of the arguments to the $.ajax()
function as shown here:
var form = {
name: 'great form',
load:function() {
$.ajax({
context: this, // sets 'this' pointer for success callback
url: "get/data",
type: "POST",
success: function(response){
console.log(this.name); // outputs : "great form"
console.log(response.data); // ajax response data
});
});
};