27 December, 2015

View a Json Object in the console

At least in Google Chrome this works like a charm:

var xhr = new XMLHttpRequest();
responseObject = JSON.parse(xhr.responseText);
console.log(responseObject);
var openFile = "weather.json"; // sample file

xhr.open('GET',openFile,true);

xhr.send(null);

The Json Object in a Chrome Console

No comments: