Use Log in loader too

This commit is contained in:
rejas 2020-05-11 23:13:53 +02:00
parent c60446a015
commit 0cae954f80

View File

@ -177,15 +177,11 @@ var Loader = (function () {
script.type = "text/javascript";
script.src = fileName;
script.onload = function() {
if (typeof callback === "function") {
callback();
}
if (typeof callback === "function") {callback();}
};
script.onerror = function() {
console.error("Error on loading script:", fileName);
if (typeof callback === "function") {
callback();
}
Log.error("Error on loading script:", fileName);
if (typeof callback === "function") {callback();}
};
document.getElementsByTagName("body")[0].appendChild(script);
@ -197,15 +193,11 @@ var Loader = (function () {
stylesheet.type = "text/css";
stylesheet.href = fileName;
stylesheet.onload = function() {
if (typeof callback === "function") {
callback();
}
if (typeof callback === "function") {callback();}
};
stylesheet.onerror = function() {
console.error("Error on loading stylesheet:", fileName);
if (typeof callback === "function") {
callback();
}
Log.error("Error on loading stylesheet:", fileName);
if (typeof callback === "function") {callback();}
};
document.getElementsByTagName("head")[0].appendChild(stylesheet);