Hi!
I am going through the Introducing asynchronous JavaScript section and have got a local copy of async-sync.html file to work. I think I need to keep a local copy of the coffee.jpg but I dont know how to download it from Github. I have tried the download option on Github but that didnts work.
Would someone be able to advise me on the best way I could get this to work locally?
Update following a git clone
I carried out a git clone to my local desktop of the learning area. Then I opened the async-sync.html file on the browser and the error message I got was the same
**
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/rpier/OneDrive/Desktop/learning-area/javascript/asynchronous/introducing/coffee.jpg. (Reason: CORS request not http).
**
I realise that this error is due to " CORS requests may only use the HTTPS URL scheme, but the URL specified by the request is of a different type. This often occurs if the URL specifies a local file, using a file:/// URL."
My question then is how do I get this to work locally?
The answer was staring me in the face in the same page though inconveniently it was at the bottom of the page
Note : For security reasons, you can’t fetch() files from your local filesystem (or run other such operations locally); to run the above example locally you’ll have to run the example through a local webserver.
So I loaded up python and ran a local server and it worked!