mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01: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:
parent
f5a37ab4a9
commit
34d4b0ccb9
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user