diff --git a/wasm/index.html b/wasm/index.html
index 1ffb20b..e78aea5 100644
--- a/wasm/index.html
+++ b/wasm/index.html
@@ -52,6 +52,8 @@
Offline HSM Attestation
Verify Bundle
+
+
diff --git a/wasm/scriptmod.js b/wasm/scriptmod.js
index a0efea4..a90c9e0 100644
--- a/wasm/scriptmod.js
+++ b/wasm/scriptmod.js
@@ -41,20 +41,14 @@ var Singleton = (async () => {
function clearTable() {
- let table = document.getElementsByClassName("attestation_table");
- if (table && table.length > 0) table.remove();
- //for (const element of document.getElementsByClassName("attestation_table")) {
- // try {
- // element.remove();
- // //element.parentELement.remove();
- // } catch (e) {}
- //}
- //document.getElementById("attestation_table").remove();
-
+ let table = document.getElementById("table_container");
+ while (table.firstChild) {
+ table.firstChild.remove();
+ }
}
function toTable(parsed_attestation) {
- let table = '';
+ let table = '';
table += "Attribute Name | Value |
";
for (i = 0; i < parsed_attestation.length; i++) {
@@ -66,10 +60,10 @@ var Singleton = (async () => {
});
}
- table += '
';
- //document.body.insertAdjacentHTML('beforeend', table);
- document.getElementById("main_container").insertAdjacentHTML('beforeend', table);
- //document.body.innerHTML += table;
+ table += '
';
+
+ let fragment = document.createRange().createContextualFragment(table);
+ document.getElementById("table_container").appendChild(fragment);
}
function toTableSplit(parsed_attestation) {