I have the following:
var row = 99;
$.ajax({
cache: false,
url: "/Admin/" + obj.table + "s/JsonUpdate",
dataType: 'json',
type: 'POST',
data: { PartitionKey: pk,
RowKey: rk,
Entity: entity,
Field: type,
Value: val }
})
.done(updateFieldDone(json, textStatus, XMLHttpRequest, row))
.fail(function (jqXHR, textStatus, errorThrown) {
ajaxOnFailure(jqXHR, textStatus, errorThrown)
});
But I am confused about what exactly is returned with .done. Is it okay to code updateFieldDone(json, textStatus, XMLHttpRequest, row) like this. Previously i just had updateFieldDone() but the problem I have is that I need to pass a parameter called row. How can I do that?
You could use the
contextparameter to pass additional data to the success callback:or if you want it in a separate function:
and then define the function: