In my backbone code, I’m getting the returned value to a variable and now I have to access one particular value with that variable.
Following is the returned value from the server
Object {
readyState = 4,
responseText = '{"analysis":{"created_a...s"],"status":"active"}}',
status = 201,
more...
}
This is how I get the above result in console
attributes = {
locale: $action.find('#locale').val(),
title: $action.find('#title').val(),
category: $action.find('#category').val(),
status: $action.find('#analysis_status').val(),
matrix: $action.find('#analysis_matrix').val(),
predefined_barriers: barrierTexts,
features: featureTexts
}
b = this.model.save(attributes);
What I want is to access the responseText
How can I access it with the variable b or is there any other good way to do it
Thanks
The
savemethod returns thejqXHRobject that is returned by the internally usedjQuery.ajax, so you can just add a callback to it as usual: