Sorry first for my bad english.
I have a DIV with an ID, which I let fill with a table.
In JavaScript / jQuery I have a For loop which defines the content of the table. So far it works, but for some unknown reason I can't access the JSON output. I would be very grateful for a hint what is wrong.
<div id="output"></div>
<script>
var urlParams = new URLSearchParams(window.location.search);
var split = urlParams.get('query').split(',');
var output = "<table id='table'>";
for(var i=0;i <split.length;i++){
$.getJSON("http://example.com/?query=" + split[i] + "", function(JSONOut) {
var JSONoutput[i] = JSONOut.id
});
var output = output + "<tr class='z'>";
var output = output + "<td><div class='ausgabe1'>" + split[i] + "</div></td>";
var output = output + "<td><div class='ausgabe1'>" + JSONoutput[i] + "</div></td>";
var output = output + "</tr>";
}
}
var output = output + "</table>";
$('#output').html(output );
</script>