Skip to content

Instantly share code, notes, and snippets.

@irfan
Created November 29, 2012 05:53
Show Gist options
  • Save irfan/4167062 to your computer and use it in GitHub Desktop.
Save irfan/4167062 to your computer and use it in GitHub Desktop.
function(response, status, xhr) {
if (checkResponse(xhr) === 'json') {
// call error handler
if (response.success !== true) {
that.get('errorHandler').check(response);
}
// check whether there is a message
if (response.message !== null) {
// if there is a message show it.
that.get('notify').show({
type: response.success,
content: response.message
});
}
// if there is a data
if (response.data.length > 0) {
return data;
}
}
// when response is a html
if (checkResponse(xhr) === 'html') {
return response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment