if( navigator.appName.indexOf("Microsoft") > -1 ) // IE?

{

    if( navigator.appVersion.indexOf("MSIE 6") > -1) // IE6?

    {

        // code

   }

    else if( navigator.appVersion.indexOf("MSIE 7") > -1) // IE7?  

    {

        // code

    }

}


출처 - http://www.dezrare.com/604


===================================================================================


1. 브라우저 헤더정보

<script language="javascript">
 
function userAgent()
{
 var browserType = "";
 if(navigator.userAgent.indexOf("MSIE") != -1)
 {
  browser = "IE";
  return browserType;
 }
 if(navigator.userAgent.indexOf("Firefox") != -1)
 {
  browser = "FF";
  return browserType;
 }
 if(navigator.userAgent.indexOf("Mozilla") != -1)
 {
  browser = "MZ";
  return browserType;
 }
 if(navigator.userAgent.indexOf("Opera") != -1)
 {
  browser = "OP";
  return browserType;
 }
 if(navigator.userAgent.indexOf("Safari") != -1)
 {
  browser = "SF";
  return browserType;
 }
 if(navigator.userAgent.indexOf("Mac") != -1)
 {
  browser = "MC";
  return browserType;
 }

 browser = "NG";
 return browserType;
}
</script>

2. 객체존재여부
<script language="javascript">
function userAgent()
{
 if(window.ActiveXobject){
  browser = "IE";
  return browserType;
 }
 else {
  browser = "NG";
  return browserType;
 }
}
</script>


 출처: http://blog.naver.com/cowboy0626/30007053474





Posted by linuxism
,