I don’t know how to explain this but I hope you understand me.
It gave me two errror messages when I tried opening my solution in my browser. The errors are:
- json1-download.html:33 Fetch API cannot load file:///C:/Users/USER/Desktop/MDN%20learning/learning-area/javascript/oojs/tasks/json/sample.json. URL scheme must be “http” or “https” for CORS request.
- json1-download.html:33 Uncaught (in promise) TypeError: Failed to fetch
at json1-download.html:33
(anonymous) @ json1-download.html:33
Promise.then (async)
(anonymous) @ json1-download.html:35
I later tried doing it here on MDN and it works. My question is what’s wrong with the one I uploaded in my browser(I used Chrome and firefox)?
This is the link to what I tried using codepen(the same thing I did in my files):