var stringStr; var Http = new XMLHttpRequest(); var url='https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD'; http.open('GET',url); var string=JSON.parse(Http.responseText); console.log(string ); http.send(); // // var getJSON = function(url, callback) { // var xhr = new XMLHttpRequest(); // xhr.open('GET', url, true); // xhr.responseType = 'json'; // var responseText=JSON.parse(xhr.response) // xhr.onload = function() { // var status = xhr.status; // if (status === 200) { // callback(null, xhr.response); // } else { // callback(status, xhr.response); // } // }; // xhr.send(); // console.log(responseText ); // };