If you are running a page directly from Chrome (you just double clicked on an html file) and you’re javascript is trying to request some data you will hit an error that looks something like the following:
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
You can see the error in the console of your browser. To view the console check How to Open/Activate Web Developer Tools on Chrome, Firefox and Safari Browsers
The Reason
You are not opening the page through a server, like Apache or nginx, so when the browser tries to obtain the resource it thinks it is from a separate domain, which is not allowed.
The Solution
Run a Server on your Machine
Open your page through a web server like Apache, nginx, node etc.
Use a Different Browser
I did not find this error when directly opening the page using Firefox and Safari.
Contributions
- Krill Fuchs‘s answer to this Stackoverflow Question