안녕하세요 해외에서 수업 잘 듣고 있는 학생입니다.
저도 위에 먼저 어느분이 질문하신 것처럼
콘솔창에 이런 오류가 떴습니다.
Access to script at 'file:/// ' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
그래서
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server
을 참고해 localhost server를 구축해서 다시 시도해봤는데
콘솔창에 또 다른 에러가 뜹니다..
GET http://localhost:8000/Users/jiyoonyu/Desktop/coding/mylibrary.js net::ERR_ABORTED 404 (File not found)
var a 가 뭔지 콘솔창에 물어봐도
Uncaught ReferenceError: a is not defined
at <anonymous>:1:1
모른다고 잡아 뗍니다 ㅠ
파일경로가 아닌 localhost만 사용하면 해결될 줄 알았는데 왜이러는 건지 알려주시면 감사하겠습니다.
감사합니다