Can anyone help me understand why the following code does not display any content in the second alert? Browsing to the same url that I pass to getJSON() produces output in my browser window.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<script>
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=Chicago,IL&sensor=false',
function(json, textStatus) {
alert("textStatus:" + textStatus);
var out = '';
for (var i in json) {
out += i + ": " + json[i] + "\n";
}
alert(out);
//alert("JSON Data:" + json.results[0].formatted_address);
});
</script>
</body>
</html>