제목
×
재생속도 설정
상태 메시지
랜드모아(pc)
|
2017-03-12 05:14:39
|
|
댓글:(0)
조회:1621
|
|
|
|
브라우저 체크
브라우저가 Ineternet Explorer인 경우
<!--[if !IE]>
// 코드
<![endif]-->
브라우저가 IE 8인 경우
<!--[if IE 8]> // 코드 <![endif]-->
브라우저가 IE 8 이하인 경우
<!--[if lte IE 8]> // 코드 <![endif]-->
브라우저가 IE 8 이상(IE8 미포함)인 경우
<!--[if gt IE 8]>// 코드 <![endif]-->
브라우저가 IE가 아닌 경우
<!--[if !IE]> // 코드 <![endif]-->
예시
예시 1 – IE 8 이하인 경우 특정 사이트로 리디렉션 :
<!--[if lte IE 8]>
<script type="text/javascript">
window.location = "http://www.example.com/";
</script>
<![endif]-->
예시 2:
<!--[if lte IE 8 ]> // 코드
<![endif]--><!--[if !lte IE 8 ]>
// 코드
<![endif]-->
예시 3:
<!--[if lt IE 7]><html class="ie6" lang="euc-kr"><![endif]-->
<!--[if IE 7]><html class="ie7" lang="euc-kr"><![endif]-->
<!--[if IE 8]><html class="ie8" lang="euc-kr"><![endif]-->
<!--[if gt IE 8]><!--><html lang="euc-kr"><!--<![endif]-->
참고로 브라우저가 IE 8 이하인지를 체크하는 PHP 코드로 다음을 사용할 수 있습니다.
if(preg_match('/(?i)msie [2-8]/',$_SERVER['HTTP_USER_AGENT']))
// Source: stackoverflow
브라우저가 IE, 파이어폭스(Firefox), 사파리, 크롬(Chrome), 오페라(Opera)인지를 체크하려면 다음 코드를 이용할 수 있습니다.
if(preg_match('/MSIE/i',$u_agent))
{
$ub = "ie";
}
elseif(preg_match('/Firefox/i',$u_agent))
{
$ub = "firefox";
}
elseif(preg_match('/Safari/i',$u_agent))
{
$ub = "safari";
}
elseif(preg_match('/Chrome/i',$u_agent))
{
$ub = "chrome";
}
elseif(preg_match('/Flock/i',$u_agent))
{
$ub = "flock";
}
elseif(preg_match('/Opera/i',$u_agent))
{
$ub = "opera";
}
// Source: stackoverflow |
|
|
|
|
|
|
|
|
|
html5 |
페이지: 1 / 1
|
|
[1] |
|
|
복수단어 검색은 공백(space)로 구분해 주세요.
|