|
|
|
|
@ -212,14 +212,20 @@ var cachedAssetsManager = (function() {
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
var getTextFileFromURL = function(url, onLoad, onError) {
|
|
|
|
|
var onResponseReceived = function() {
|
|
|
|
|
if ( typeof this.status === 'number' && this.status >= 200 && this.status < 300 ) {
|
|
|
|
|
return onLoad.call(this);
|
|
|
|
|
}
|
|
|
|
|
return onError.call(this);
|
|
|
|
|
};
|
|
|
|
|
// console.log('assets.js > getTextFileFromURL("%s"):', url);
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
|
xhr.open('get', url, true);
|
|
|
|
|
xhr.responseType = 'text';
|
|
|
|
|
xhr.timeout = 15000;
|
|
|
|
|
xhr.onload = onLoad;
|
|
|
|
|
xhr.onload = onResponseReceived;
|
|
|
|
|
xhr.onerror = onError;
|
|
|
|
|
xhr.ontimeout = onError;
|
|
|
|
|
xhr.open('get', url, true);
|
|
|
|
|
xhr.send();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|