How can I read a data from json separate file (f.e. 'data.json') in another file ('index.html') using javascript - in a simplest way ?
When I use it in the same file there is no problem:
data = '[{"name" : "Harry", "age" : "32"}]';
var j = JSON.parse(data);
document.getElementById('res').innerHTML = j[0].name;
But I cant manage to do that when I use external json file with:
'[{"name" : "Harry", "age" : "32"}]';
I'm looking for the SIMPLEST way (problably I'm missing some fundamental)