1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00

try catch put in for loop it is just for checking and logging errors, the program should go on even wrong cinfig type comes from the backend(worng config type will be skipped)

This commit is contained in:
Cevo 2015-10-08 11:25:14 +02:00
parent f5a37ab4a9
commit 34d4b0ccb9

View File

@ -13,13 +13,17 @@ let constructHeadElement = function(elementType, elementId, elementAttributes) {
var oldElement = document.getElementById(elementId);
try {
for (let k in elementAttributes){
element.setAttribute(k, elementAttributes[k]);
try {
element.setAttribute(k, elementAttributes[k]);
}
catch(e){
console.log(e.message);
console.log(elementAttributes);
continue;
}
}
}
catch(e){
console.log(e.message);
console.log(elementAttributes);
}
if (oldElement) {
head.removeChild(oldElement);
}