What about people? 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>