If you tried to open the test-page.html or other HTML files directly in your browser, you might have noticed that:
The simplest way to test your website is to upload it to Neocities and view it there:
git push
For local testing, you can use a simple web server:
# Navigate to your website directory cd /Users/leah.wilson-duff/Documents/GitHub/Prototypes/personal-dot-com # Python 3 python -m http.server # Python 2 python -m SimpleHTTPServer
Then visit http://localhost:8000 in your browser.
# Install a simple server (one-time setup) npm install -g http-server # Navigate to your website directory cd /Users/leah.wilson-duff/Documents/GitHub/Prototypes/personal-dot-com # Start the server http-server
Then visit http://localhost:8080 in your browser.
The issue occurs because modern browsers implement a security feature called the Same-Origin Policy, which restricts how documents or scripts loaded from one origin can interact with resources from another origin. When you open a file directly from your filesystem (using the file://
protocol), it's considered a different origin than other local files, even if they're in the same directory.
Using a web server (even a local one) solves this problem because all files are served from the same origin (e.g., http://localhost:8000
).
Choose one of the methods above to properly test your website. Once you're using a proper web server, you'll be able to see all the features working correctly, including: