Remove unneccessary vars

This commit is contained in:
Fred Boniface 2023-04-22 22:46:46 +01:00
parent 896ff6a532
commit a63e861162

View File

@ -33,7 +33,6 @@ async function insertData(json) {
<th class="stops">Stations</th> <th class="stops">Stations</th>
</tr>` </tr>`
div.insertAdjacentHTML("beforeend", tableHtml) div.insertAdjacentHTML("beforeend", tableHtml)
const table = document.getElementById('result-table')
const data = JSON.parse(json) const data = JSON.parse(json)
let results = 0 let results = 0
for(var i = 0; i < data.length; i++) { // Break into separate function. Need to for(var i = 0; i < data.length; i++) { // Break into separate function. Need to
@ -44,7 +43,7 @@ async function insertData(json) {
results++ results++
} }
tableData += "</table>" tableData += "</table>"
table.insertAdjacentHTML("beforeend", tableData) document.getElementById('result-table').insertAdjacentHTML("beforeend", tableData)
document.getElementById('result-count').textContent = results document.getElementById('result-count').textContent = results
} }