mirror of
https://github.com/Codiad/Codiad.git
synced 2026-03-10 11:16:48 +01:00
23 lines
571 B
JavaScript
23 lines
571 B
JavaScript
(function(global, $){
|
|
|
|
var codiad = global.codiad;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Parse JSEND Formatted Returns
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
codiad.jsend = {
|
|
|
|
parse: function(d) { // (Data)
|
|
var obj = $.parseJSON(d);
|
|
if (obj.status == 'error') {
|
|
codiad.message.error(obj.message);
|
|
return 'error';
|
|
} else {
|
|
return obj.data;
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
})(this, jQuery); |