모더나이저

(Modernizr에서 넘어옴)

모더나이저(Modernizr)는 작은 크기의 자바스크립트 라이브러리로서, 사용자가 현재 이용중인 웹 브라우저에서 HTML5CSS3가 지원하는 기능 중 어떤 기능을 지원하는지 알아볼 때 사용한다.

모더나이저
원저자Faruk Ateş
개발자Faruk Ateş, Paul Irish, Alex Sexton, Ryan Seddon, Patrick Kettner, Stu Cox, Richard Herrera, 기여자들
발표일2009년 7월 1일(14년 전)(2009-07-01)[1]
안정화 버전
3.6.0 / 2018년 5월 28일(5년 전)(2018-05-28)[2]
저장소
프로그래밍 언어자바스크립트
종류자바스크립트 라이브러리
라이선스MIT; 과거: 듀얼 라이선스 MIT-BSD 2010년 6월 14일부터[3] 2012년 9월 15일까지[4]
웹사이트modernizr.com

예시 편집

모더나이저 자바스크립트 예제 편집

<!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>

같이 보기 편집

각주 편집

  1. Faruk Ateş (2009년 7월 1일). “Proudly Announcing Modernizr”. 2016년 8월 1일에 원본 문서에서 보존된 문서. 2019년 5월 27일에 확인함. 
  2. “Releases · Modernizr/Modernizr” (영어). 
  3. “Modernizr 1.5: new features, unit tests added”. Modernizr. 2010년 6월 14일. 2013년 7월 30일에 확인함. 
  4. “Remove BSD license and improve readme”. GitHub. 2012년 9월 15일. 2013년 7월 30일에 확인함. 

외부 링크 편집