request methods: don't throw if no callback is passed
This commit is contained in:
parent
cc454e5f80
commit
16b6811b75
1 changed files with 2 additions and 4 deletions
|
@ -51,7 +51,7 @@ Ox.getAsync = function(urls, get, callback) {
|
||||||
urls = Ox.clone(Ox.makeArray(urls));
|
urls = Ox.clone(Ox.makeArray(urls));
|
||||||
var errors = {}, i = 0, n = urls.length, results = {};
|
var errors = {}, i = 0, n = urls.length, results = {};
|
||||||
function done() {
|
function done() {
|
||||||
callback(
|
callback && callback(
|
||||||
n == 1 ? results[urls[0]] : results,
|
n == 1 ? results[urls[0]] : results,
|
||||||
n == 1 ? errors[urls[0]] : Ox.some(errors, function(error) {
|
n == 1 ? errors[urls[0]] : Ox.some(errors, function(error) {
|
||||||
return error !== null;
|
return error !== null;
|
||||||
|
@ -214,9 +214,7 @@ Ox.getJSONC <f> Get and parse a remote JSONC file
|
||||||
For multiple URLs, keys are file names, values are error objects
|
For multiple URLs, keys are file names, values are error objects
|
||||||
@*/
|
@*/
|
||||||
Ox.getJSONC = function(url, callback) {
|
Ox.getJSONC = function(url, callback) {
|
||||||
Ox.getJSON(url, function(results, errors) {
|
Ox.getJSON(url, callback, true);
|
||||||
callback(results, errors);
|
|
||||||
}, true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
|
|
Loading…
Reference in a new issue