Changeset - 22d02efb8aa2
[Not reviewed]
0 2 0
x - 15 months ago 2024-01-05 02:42:39
xbr@c3l.lu
feat: replace appending with replacing of the table
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
frontend/index.html
Show inline comments
 
@@ -15,6 +15,7 @@
 

	
 
    <div class="logs" id="logs">
 
        <p class="logs__title">Last incidents</p>
 
        <table id="logs__table"></table>
 
    </div>
 
	</body>
 
</html>
frontend/script.js
Show inline comments
 
@@ -31,8 +31,9 @@ function generateTable(data) {
 

	
 
    const table = document.createElement("table");
 
    table.classList.add("logs__table");
 
    table.id = "logs__table";
 
    table.appendChild(tableBody);
 
    document.getElementById("logs").appendChild(table);
 
    document.getElementById("logs__table").replaceWith(table);
 
    } catch (e) {}
 
}
 

	
0 comments (0 inline, 0 general)