获取客户端使用的浏览器

获取是什么浏览器 

<script>

getOs();
 function getOs()   
 {   
     var OsObject = "";   
    if(navigator.userAgent.indexOf("MSIE")>0) {  //ie
       document.getElementById('selectpic').src="http://www.bioon.com.cn/images/2010/ie.gif";
       document.getElementById('selectpic').title="添加到浏览器收藏夹";
    } else{   //非ie
      document.getElementById('selectpic').src="http://www.bioon.com.cn/images/2010/fie.jpg";
      document.getElementById('selectpic').title="添加到浏览器书签";
    }   
}   

</script>

asp

<%

 nstr=request.serverVariables("HTTP_USER_AGENT")     

  if   instr(1,nstr,"MSIE   6.0",1)>0   then     
  response.write("您使用的是IE6.0浏览器")     
  elseif   instr(1,nstr,"MSIE   5.0",1)>0   then     
  response.write("您使用的是IE5.0浏览器")     
  elseif   instr(1,nstr,"firefox",1)>0   then     
  response.write("您使用的是   FIREFOX   浏览器")     
  else     
  response.write("未知浏览器类型")     
  end   if

%> 

posted @ 2011-02-23 11:07  龙圆  阅读(265)  评论(0编辑  收藏  举报