(092)jquery_工具函数_browser

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>util_browser.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        #divtest
        {
            width: 282px;
        }
        #divtest .title
        {
            padding: 8px;
            background-color: Blue;
            color: #fff;
            height: 23px;
            line-height: 23px;
            font-size: 15px;
            font-weight: bold;
        }
        #divtest .content
        {
            padding: 8px;
            background-color: #fff;
            font-size: 13px;
        }
        .fl
        {
            float: left;
        }
        .fr
        {
            float: right;
        }
    </style>
    <script type="text/javascript" src="../js/jquery/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
        $(function(){
            var strTmp = "您的浏览器的名称是:";
            if($.browser.chrome) {
                strTmp += "Chrome";
            }
            else if($.browser.mozilla) {
                strTmp += "Mozilla FireFox";
            }
            else if($.browser.msie) {
                strTmp += "IE";
            }
            strTmp += "</br></br>版本号是:" + $.browser.version; 
            $(".content").html(strTmp);
        });
    </script>
  </head>
  
  <body>
        <div id="divtest">
            <div class="title">
                <span class="fl">获取浏览器名称和版本号</span> 
            </div>
            <div class="content"></div>
        </div>
  </body>
</html>

 

posted @ 2015-01-19 13:49  雪中飞雁  阅读(66)  评论(0)    收藏  举报