zoukankan      html  css  js  c++  java
  • 浏览器识别(转)

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
     2 <html xmlns="http://www.w3.org/1999/xhtml" >   
     3 <head id="Head1" runat="server">   
     4     <title>判断是哪种浏览器及版本</title>   
     5     <script type="text/javascript" src="../../../JS/jquery-1.4.2.min.js"></script>   
     6     <script type="text/javascript">   
     7         //判断浏览器   
     8         function GetExplorer() {   
     9             var explorer = window.navigator.userAgent ;   
    10             if ($.browser.msie) {   
    11                 alert("IE " + $.browser.version);   
    12             }   
    13             else if ($.browser.mozilla) {   
    14                 alert("Firefox " + $.browser.version);   
    15             }   
    16             else if($.browser.opera){   
    17                 alert("Opera " + $.browser.version);   
    18             }   
    19             else if($.browser.safari){   
    20                 alert("Safari " + $.browser.version);   
    21             }   
    22             else {   
    23                 alert("Chrome或其他浏览器")   
    24             }   
    25         }   
    26     </script>   
    27 </head>   
    28 <body>   
    29 <!-- runat="server" 表示是在服务器端运行的控件 -->
    30     <form id="form1" runat="server">   
    31     <div>   
    32         <a href="javascript:" onclick="GetExplorer();">测试一</a>   
    33     </div>   
    34     </form>   
    35 </body>   
    36 </html>
  • 相关阅读:
    C# 文件类的操作---删除
    C#实现Zip压缩解压实例
    UVALIVE 2431 Binary Stirling Numbers
    UVA 10570 meeting with aliens
    UVA 306 Cipher
    UVA 10994 Simple Addition
    UVA 696 How Many Knights
    UVA 10205 Stack 'em Up
    UVA 11125 Arrange Some Marbles
    UVA 10912 Simple Minded Hashing
  • 原文地址:https://www.cnblogs.com/nostic/p/5731165.html
Copyright © 2011-2022 走看看