$.get('/mydata', { success: onSuccess, failure: onFailure, always: onAlways }); function onAlways() { console.log('onAlways') } function onFailure() { console.log('onFailure') } function onSuccess() { console.log('onSuccess') }