3
Hey guys? I’m new here, could you help me...is returning "Nan"!
<!DOCTYPE html>
<html>
<body>
<h1>Customers</h1>
<div id="id01"></div>
<script>
var xmlhttp = new XMLHttpRequest();
var url = "http://www.w3schools.com/website/customers_mysql.php";
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp.responseText);
}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
function myFunction(response) {
var arr1 = JSON.parse(response);
var out = "<h1>";
out += arr1.Name + arr1.City + arr1.Country;
out += "</h1>";
document.getElementById("id01").innerHTML = out;
}
</script>
</body>
</html>
What is returning Nan?
– user28595
Puts the comeback
json
.– Edilson
My idea was to return only return index 1 of the array ....
– Johnner