百度首页 | 百度空间
 
查看文章
 
简单判断浏览器是否IE 是否IE6
2008-06-11 13:58

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function(){

//------------------是不是IE ?
var IE=(!this.isOpera&&document.all&&navigator.userAgent.match(/msie/gi))?true:false;

   if(IE) {
       alert("我是IE");  
      } else{
       alert("你才是IE,你全家都是IE!");   
     }


//----------------是不是IE6 ?

if (window.XMLHttpRequest) {
alert("我才不是IE6呢")
} else {
alert("我是IE6,怎么着?");
}

}

</script>
</head>

<body>
</body>
</html>


类别:Ie Vs Firefox | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu