diff --git a/js/pis.js b/js/pis.js index c546a5c..b4f5c1d 100644 --- a/js/pis.js +++ b/js/pis.js @@ -33,9 +33,7 @@ async function insertData(json) { Stations ` let results = 0 - for(var i = 0; i < json.length; i++) { // Break into separate function. Need to - // iterate over stops and print them in the - // format: `AVN, PRI, SHH... etc.` + for(var i = 0; i < json.length; i++) { // Hopefully can style output with CSS tableData += `${json[i]['code']} ${json[i]['stops']}` results++ @@ -48,7 +46,7 @@ async function insertData(json) { } async function noData() { - const msg = '

No results found

' + const msg = '

No results found

' document.getElementById('result-box').insertAdjacentHTML("beforeend", msg) } @@ -56,6 +54,6 @@ async function reset() { document.getElementById('origin').value = "" document.getElementById('destination').value = "" document.getElementById('result-box').style = 'display:none' - document.getElementById('result-box').innerHTML = '' // This removes the results-count. I need to remove the ONLY. + document.getElementById('result-table').remove() document.getElementById('crs-box').style = 'display:block' } \ No newline at end of file