Files
deployd/public/deployd.js
2011-11-02 09:09:50 -07:00

26 lines
500 B
JavaScript

function d(route, data, callback) {
var arg
, i = 0
, options = {
dataType: 'json',
contentType: 'application/json'
}
;
while(arg = arguments[i++]) {
switch(typeof arg) {
case 'string':
options.url = arg;
break;
case 'object':
options.data = JSON.stringify(arg);
options.type = 'POST';
break;
case 'function':
options.error = options.success = arg;
break;
}
}
$.ajax(options);
}