
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
숙제 내용대로 진행후 자바스크립트가 잘 작동하는지 실행하려는데 콘솔창에서
food_homework.html:1 Access to script at 'file:///C:/Users/ChessPark/ChessDrive/Code/Sparta/web_homework2/food_homework.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
다음과 같이 뜨면서 실행이 되지 않는 것을 확인했습니다. 폴더와 파일이름도 영어로 바꿔보고 여러가지 해봤지만, 처음주신 숙제파일부터가 위와 같은 에러가 떠서 구글링해보니 보안정책에 따른 오류라고, 뭘 해보라고 해서 해봤는데도 실행을 할 수가 없더라구요.
공부시간이 별로 안남아서 결국 실행해보지 못하고, 숙제파일을 업로드했습니다.
코드엔 이상이 없어서 잘 실행될거 같은데, 직접 실행되는걸 보지 못하니 매우 답답하네요.
이와 관련해서(로컬컴퓨터에서 js파일이 분리된 html을 실행하는 방법) 피드백해주시면 좋겠습니다.
작성한 코드 및 에러 메세지
food_homework.html:1 Access to script at 'file:///C:/Users/ChessPark/ChessDrive/Code/Sparta/web_homework2/food_homework.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
