다른웹사이트 설명 : https://code.i-harness.com/ko-kr/q/1a74f76
결론 : html 파일을 서버에 업로드 해야한다..
Solution to Chrome Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
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
'코딩' 카테고리의 다른 글
Atom 패키지 / vscode extention (0) | 2018.11.13 |
---|---|
웹서버 운영 : 윈도우 (아파치, 설치, 웹서버와 http, 웹브라우저와 웹서버의 통신) (0) | 2018.11.11 |
d3fc 사용법 (0) | 2018.11.10 |
윈도우 명령프롬프트 cmd 키 설정 (경로 종료 따위) (0) | 2018.11.10 |
파이선 장고 실행 : 초기 pip 설치/ 패키지 / path (0) | 2018.11.10 |