I wrote following Code which runs nicely on the old Internet Explorer, but not on Firefox, Chrome, Edge etc. Is the problem the fact that I am importing the json via http and not https? And if so, how can I adjust this? Any help is appreciated!
<head>
<script>
var myObj, x, txt = "";
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
txt += "<table border='1'>"
for (x in myObj.Data) {
txt += "<tr><td>" + myObj.Data[x].Name + "</td></tr>";
}
txt += "</table>"
document.getElementById("demo").innerHTML = txt;
}
}
xmlhttp.open("GET", "http://134.255.254.137/Data.json");
xmlhttp.send();
</script>
</head>
<html>
<body>
<div class="container">
<h2>Daten aus JSON-Datei:</h2>
<div id="demo">
</div>
</div>
</body>
</html>