"JavaScript load JSON file from desktop – how does it work?"
hey guys, i'm trying to figure out how to use javascript load json file from desktop. like, i have a `data.json` on my pc and wanna read it in my js code.
i tried `fetch()` but it gives me CORS errors. is there a simple way to do this without setting up a server?
also, what about the FileReader API? does that work for local files? or do i need user to manually select the file every time?
any quick examples or tips would be awesome! thanks in advance
(ps. if this is a dumb question, pls go easy on me lol)
hey guys, i'm trying to figure out how to use javascript load json file from desktop. like, i have a `data.json` on my pc and wanna read it in my js code.
i tried `fetch()` but it gives me CORS errors. is there a simple way to do this without setting up a server?
also, what about the FileReader API? does that work for local files? or do i need user to manually select the file every time?
any quick examples or tips would be awesome! thanks in advance
(ps. if this is a dumb question, pls go easy on me lol)
