jquery获取浏览器类型和版本号方法

<script type="text/javascript"> 
$(document).ready(function(){ 
   var brow=$.browser; 
   var bInfo=""; 
   if(brow.msie) {bInfo="Microsoft Internet Explorer "+brow.version;} 
   if(brow.mozilla) {bInfo="Mozilla Firefox "+brow.version;} 
   if(brow.safari) {bInfo="Apple Safari "+brow.version;} 
   if(brow.opera) {bInfo="Opera "+brow.version;} 
      alert(bInfo); 
   $("#browser").html(bInfo); 
}) 
</script>

 

posted @ 2013-01-17 16:32  binfire005  阅读(16393)  评论(0编辑  收藏  举报