웹으로 접근시 콘솔에서 다음과 같은 에러를 확인할 수 있었다.
GET https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js net::ERR_NAME_NOT_RESOLVEDUnderstand this error
norifarm.com/:15
GET https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js net::ERR_NAME_NOT_RESOLVEDUnderstand this error
default.js:635 Uncaught ReferenceError: $ is not defined
at default.js:635:1
(anonymous) @ default.js:635Understand this error
guide.js:2 Uncaught ReferenceError: $ is not defined
at guide.js:2:1
(anonymous) @ guide.js:2Understand this error
main.js:881 Uncaught ReferenceError: $ is not defined
at main.js:881:1
1. GET https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js net::ERR_NAME_NOT_RESOLVED
원인: DNS 문제가 발생하여 브라우저가 요청한 URL을 해석하지 못할 때 발생한다. ERR_NAME_NOT_RESOLVED는 헤당 CDN 주소를 찾지 못해서 발생하는 네트워크 오류이다.
해결: 대체 CDN 사용 (aspnet.com이 동작하지 않으므로, cndjs CDN 에서 jQuery를 로드하여 사용하였다)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
2. GET https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js net::ERR_NAME_NOT_RESOLVED
원인: CND 을 통해 jQuery UI 파일을 로드하려고 할때 도메인 이름을 해석하지 못해 발생하는 문제이다.
해결: jQuery UI도 다른 CDN에서 불러오거나 로컬에서 직접 제공하는 방식으로 해결 가능.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
3. Uncaught ReferenceError: $ is not defined
원인: $ is not defined 오류는 jQuery가 로드되지 않아서 발생하는 문제이다.
해결: 위 문제들만 해결되면 해결 가능
'DevOps' 카테고리의 다른 글
Github actions와 Docker로 CI/CD 구축 (0) | 2024.06.22 |
---|---|
EC2 로 배포하기 (+ iTerm 이용한 빠른 접속 설정) (0) | 2024.06.20 |