Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

CORS error. html page cannot access assets folder in parent directory (Firefox, LiveServer, Windows 11)

  • 1 답장
  • 1 이 문제를 만남
  • 1 보기
  • 최종 답변자: TyDraniu

more options

My html page has a href to ..\assets\style.css and the script.js has a reference to ..\assets\images\backpack.svg

But these files do not display when it is opened in live server. The href is correct because when I type ..\assets\style.css in the Windows File Explorer address bar, it opens the css file correctly.

I tried to load the html directly in Firefox, not LiveServer. I see in the console, Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/Me/Documents/Learn/JS/05_03/Backpack.js. (Reason: CORS request not http).

I posted all the details over here. https://stackoverflow.com/q/70416741/398348

My html page has a href to ..\assets\style.css and the script.js has a reference to ..\assets\images\backpack.svg But these files do not display when it is opened in live server. The href is correct because when I type ..\assets\style.css in the Windows File Explorer address bar, it opens the css file correctly. I tried to load the html directly in Firefox, not LiveServer. I see in the console, Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/Me/Documents/Learn/JS/05_03/Backpack.js. (Reason: CORS request not http). I posted all the details over here. https://stackoverflow.com/q/70416741/398348

모든 댓글 (1)

more options

This is how it works in Firefox. Going above the html file in a directory tree breaks The Same Origin Policy.