개발/js·jquery
jQuery 오류 - The page at '<URL>' was loaded over HTTPS, but requested an insecure script '<URL>'
HHHONG
2023. 5. 4. 22:02
반응형
카페 24에서 기존에 잘 작동하던 스크립트가 갑자기 작동하지 않았다. 개발자 모드로 오류 내역을 확인해보니 아래와 같이 써있었다.
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure script '<URL>'. This request has been blocked; the content must be served over HTTPS.
이는 https인 홈페이지에 외부 경로의 파일을 http로 불러와서 생기는 오류로, 외부 경로들을 홈페이지와 동일하게 모두 https 또는 //로 변경해주면 된다. jQuery 스크립트 경로도 변경해주고, 나의 경우에는 구글 웹폰트, 이미지에도 경로 문제가 발생하여 모두 변경해 주었다.
변경 전 예시
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
변경 후 예시
http:// → // 로 변경
<script src="//code.jquery.com/jquery-latest.min.js"></script>
반응형