모더나이저
원저자 | Faruk Ateş |
---|---|
개발자 | Faruk Ateş, Paul Irish, Alex Sexton, Ryan Seddon, Patrick Kettner, Stu Cox, Richard Herrera, 기여자들 |
발표일 | 2009년 7월 1일[1] |
안정화 버전 | 3.6.0
/ 2018년 5월 28일[2] |
저장소 | |
프로그래밍 언어 | 자바스크립트 |
종류 | 자바스크립트 라이브러리 |
라이선스 | MIT; 과거: 듀얼 라이선스 MIT-BSD 2010년 6월 14일부터[3] 2012년 9월 15일까지[4] |
웹사이트 | modernizr |
모더나이저(Modernizr)는 작은 크기의 자바스크립트 라이브러리로서, 사용자가 현재 이용중인 웹 브라우저에서 HTML5와 CSS3가 지원하는 기능 중 어떤 기능을 지원하는지 알아볼 때 사용한다.
예시[편집]
모더나이저 자바스크립트 예제[편집]
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Modernizr - JavaScript Example</title>
<script src="path/to/modernizr.js"></script>
</head>
<body>
<p id="result"></p>
<script>
elem = document.getElementById('result');
if ( Modernizr.websockets ) {
elem.innerHTML = 'Your browser supports WebSockets.';
alert("Your browser supports WebSockets");
} else {
elem.innerHTML ='Your browser does not support WebSockets.' ;
}
</script>
</body>
</html>
CSS 예제[편집]
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Modernizr - CSS Example</title>
<style>
.wsno,
.wsyes { display: none; }
/* Modernizr will add one of the following classes to the HTML element based on
whether or not WebSockets is supported by the user's browser. */
.no-websockets .wsno,
.websockets .wsyes { display: block; }
</style>
<script src="path/to/modernizr.js"></script>
</head>
<body>
<p class="wsno">Your browser does not support WebSockets.</p>
<p class="wsyes">Your browser supports WebSockets.</p>
</body>
</html>
같이 보기[편집]
각주[편집]
- ↑ Faruk Ateş (2009년 7월 1일). “Proudly Announcing Modernizr”. 2016년 8월 1일에 원본 문서에서 보존된 문서. 2019년 5월 27일에 확인함.
- ↑ “Releases · Modernizr/Modernizr” (영어).
- ↑ “Modernizr 1.5: new features, unit tests added”. Modernizr. 2010년 6월 14일. 2013년 7월 30일에 확인함.
- ↑ “Remove BSD license and improve readme”. GitHub. 2012년 9월 15일. 2013년 7월 30일에 확인함.
외부 링크[편집]
- (영어) 모더나이저 - 공식 웹사이트
이 글은 웹사이트에 관한 토막글입니다. 여러분의 지식으로 알차게 문서를 완성해 갑시다. |