用javascript进行浏览器判定

时间:2015-05-20 22:01:48   收藏:0   阅读:141

一、检验是否为IE

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>

<script> 
if(!+[1,])alert("这是ie浏览器"); 
   else alert("这不是ie浏览器"); 
</script>

</head>
<body>
</body>
</html>

  

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!