When I type the command console.log (response) it displays all information in the browser console, but for some detail, I am not able to display the data inside my div that is in the html snippet below. Can anyone point out to me what I'm letting through?
<script>
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp.responseText);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
myFunction(url);
function myFunction(response) {
var arr = JSON.parse(JSON.stringify(response));
var i;
var out = "<div>";
for(i = 0; i < arr.length; i++) {
out += "<a href='#' class='samba-playlist-trigger list-group-item active' data-mediaid=" + arr[i].id + "></a>";
}
out += "</div>";
document.getElementById("id01").innerHTML = out;
}
</script>
The display part on the html page
<div class="container">
<div class="row">
<div id="id01"></div>
</div>
</div>