In the code below, is it possible to call the error function from the else block?
$.getJSON('something.php', function(data) {
if (data.error === undefined) {
} else {
// How can I call the error function below?
}
}).error(function() {
// This is the error function the be called.
});
Just define it separately and call it: