var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var response = xhr.responseText; var res = JSON.parse(response); console.log(res.dolgozok) } } xhr.open("GET", "valami.json", true); xhr.send();