« first day (2953 days earlier)      last day (1149 days later) » 

 
4 hours later…
 
3 hours later…
4:09 PM
<head>
<title>test_async_003.html</title>
</head>
<body>
<script>
/* This is how to get the result of an XMLHttpRequest
into a global variable. */

var jsonObj;

function getObj(jsonString) {
return JSON.parse(jsonString);

};

function getFile(url, callback) {

var httpRequest = new XMLHttpRequest();
httpRequest.onload = function() {
callback(httpRequest.responseText);
};

httpRequest.open('GET', url);
httpRequest.send();

}

jsonObj = getFile( "activities.json", getObj);
console.log(jsonObj);
 
1 message moved from JavaScript
 
 
2 hours later…
 
2 hours later…
 
1 hour later…
9:21 PM
 

« first day (2953 days earlier)      last day (1149 days later) »