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