diff --git a/scripts/haltestellen.js b/scripts/haltestellen.js index 6d1925b..d1fb765 100644 --- a/scripts/haltestellen.js +++ b/scripts/haltestellen.js @@ -55,8 +55,7 @@ function ajaxCall(dataUrl, outputElement, callback) { console.log("anonymous function"); - var wurst = [["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"]]; - console.log(wurst[0][0]); + //var wurst = [["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"]]; // get the search form var searchForm = document.getElementById("search-form"); @@ -80,24 +79,28 @@ function ajaxCall(dataUrl, outputElement, callback) { var i; var y; + var htmlOutput; var dataLength = data.length; - target.innerHTML = ""; - target.innerHTML += ""; - target.innerHTML += ""; - target.innerHTML += ""; - target.innerHTML += ""; - target.innerHTML += ""; + htmlOutput = "
LinieRichtungAbfahrt
"; + htmlOutput += ""; + htmlOutput += ""; + htmlOutput += ""; + htmlOutput += ""; + htmlOutput += ""; for (i = 0; i < dataLength; i++) { - target.innerHTML += ""; + htmlOutput += ""; for (y = 0; y < 3; y++) { - target.innerHTML += ""; + htmlOutput += ""; } - target.innerHTML += ""; + htmlOutput += ""; } - target.innerHTML += "
LinieRichtungAbfahrt
" + data[i][y] + "" + data[i][y] + "
"; + htmlOutput += ""; + + // print table into web page + target.innerHTML = htmlOutput; }); } };