diff --git a/scripts/haltestellen.js b/scripts/haltestellen.js
index 10716c0..d600671 100644
--- a/scripts/haltestellen.js
+++ b/scripts/haltestellen.js
@@ -55,30 +55,6 @@ function ajaxCall(dataUrl, outputElement, callback) {
console.log("anonymous function");
- var hupatz;
- var blub = document.getElementById("output");
-
- var wurst = '[["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"],["13","Prohlis","754"]]';
- console.log(wurst);
- wurst = wurst.replace(/\],\[/gi, '#');
- wurst = wurst.slice(2,-2);
- wurst = wurst.split("#");
- console.log(wurst);
- console.log(wurst.length);
-
- hupatz = "
";
- for (var h = 0; h < wurst.length; h++) {
- hupatz += "";
- var hallo = wurst[h].split(",");
- for (var x = 0; x < hallo.length; x++) {
- hupatz += "" + hallo[x].slice(1,-1) + " | ";
- }
- hupatz += "
";
- }
- hupatz += "
"
-
- //blub.innerHTML = hupatz;
-
// get the search form
var searchForm = document.getElementById("search-form");
@@ -99,10 +75,14 @@ function ajaxCall(dataUrl, outputElement, callback) {
ajaxCall(hstUrl, target, function(data) {
+ console.log("received data: " + data);
+
data = data.replace(/\],\[/gi, '#');
data = data.slice(2,-2);
data = data.split("#");
+ console.log("parsed data: " + data);
+
var i;
var y;
var htmlOutput;
@@ -118,7 +98,9 @@ function ajaxCall(dataUrl, outputElement, callback) {
for (i = 0; i < dataLength; i++) {
htmlOutput += "";
var trala = data[i].split(",");
+ console.log("part " + i + " of parsed data: " + data)
for (y = 0; y < 3; y++) {
+ console.log("part " + y + ": " + data[y])
htmlOutput += "" + data[y].slice(1,-1) + " | ";
}
htmlOutput += "
";