"Best way to load a JSON file from desktop using JavaScript?"
Hey folks!
I'm trying to use javascript load json file from desktop for a small project, but I'm stuck. What's the easiest way to do this?
I tried `fetch()` but it’s not working—probably because of file permissions or something?
Any tips or code snippets would be awesome. Thanks in advance!
---
*Or the troubleshooting version:*
"Why isn't my javascript load json file from desktop working?"
So I’ve got this JSON file on my desktop, and my code looks like:
```js
fetch('file.json').then(res => res.json())...
```
But it’s throwing errors. Am I missing something obvious?
Is there a better way to do this? Help a noob out! 😅
Hey folks!
I'm trying to use javascript load json file from desktop for a small project, but I'm stuck. What's the easiest way to do this?
I tried `fetch()` but it’s not working—probably because of file permissions or something?
Any tips or code snippets would be awesome. Thanks in advance!
---
*Or the troubleshooting version:*
"Why isn't my javascript load json file from desktop working?"
So I’ve got this JSON file on my desktop, and my code looks like:
```js
fetch('file.json').then(res => res.json())...
```
But it’s throwing errors. Am I missing something obvious?
Is there a better way to do this? Help a noob out! 😅
