GitHub CDN 사용하기

Jmnote bot (토론 | 기여)님의 2017년 6월 27일 (화) 03:29 판 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
GitHub CDN 사용하기
Refused to execute script from http://raw.githubusercontent.com

1 문제상황

  • raw.githubusercontent.com 로 접근하면 거부됨
<link rel="stylesheet" href="//raw.githubusercontent.com/xdan/datetimepicker/master/jquery.datetimepicker.css">
<script src="//raw.githubusercontent.com/xdan/datetimepicker/master/jquery.datetimepicker.js"></script>

datetimepicker2.php:1 Refused to execute script from 'http://raw.githubusercontent.com/xdan/datetimepicker/master/jquery.datetimepicker.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

2 해결방법

  • http://rawgit.com 에 가서 URL을 입력하면 CDN 주소로 바꿔줌
  • 또는 아래와 같이 수동으로 URL을 바꿔도 사용 가능[1]
https://github.com/xdan/datetimepicker/blob/master/jquery.datetimepicker.css
https://cdn.rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.css
<link rel="stylesheet" href="//cdn.rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.css">
<script src="//cdn.rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.js"></script>

3 같이 보기

4 주석

  1. 정확하게는... rawgit.com은 non-production판, cdn.rawgit.com은 production판

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}