Good day. I have a json file stored on my computer, how can I read it and parse it with JS (XMLHttpRequest) to be used further? For example, it is "/home/user/Documents/project/data.json", do I need to add its data to the project page?
function load() { var xhr = new XMLHttpRequest(); xhr.timeout = 1000; xhr.responseType = 'json'; xhr.open('GET', '/home/ilya/Documents/for_job/data'); xhr.send() } console.log(load()); Here is the function that gets returned parsing JSON, I just need to get it, at least in order to view it, then use it, but I get 'undefined', and one more thing, the web server is not deployed.