Assuming I have the following:
var object = {
myfunc: function() {
$.ajax({
url: url,
format: format,
success: function() {
console.log(this) // This refers to the ajax call and not "object"
$.ajax({
url: url,
format: format,
success: function() {
console.log(this) // this refers to nested ajax call and not "object"
}
});
}
});
}
}
How to get "this" to reference "object" as opposed to the ajax call?