Cannot load image locally

To add to @GoToLoop’s comment –

If you open your browser developer console, you’ll see that it lists a CORS error. You need to run this from a local webserver. It looks like you’re on a Mac? Which means you have Python pre-installed.

  1. Open your Terminal application
  2. Type cd (followed by a space), then drag your website folder onto the Terminal – the line look something like this: cd /Users/username/Desktop/website; hit the enter key
  3. Then type: python -m SimpleHTTPServer, then enter
  4. Open your web browser and enter http://localhost:8000 in the address bar.

The index.html file should load automatically. It should load images fine now.

* If you’ve installed Python 3, replace step 3 with python3 -m http.server

2 Likes