1// pure javascript
2let object;
3let httpRequest = new XMLHttpRequest(); // asynchronous request
4httpRequest.open("GET", "local/path/file.json", true);
5httpRequest.send();
6httpRequest.addEventListener("readystatechange", function() {
7 if (this.readyState === this.DONE) {
8 // when the request has completed
9 object = JSON.parse(this.response);
10 }
11});