Java Blog for Alex Wan

          Let life be beautiful like summer flowers and death like autumn leaves.

          統計

          留言簿(10)

          BlogJava

          Blogs

          DIV+CSS

          JQuery相關

          友情鏈接

          常去的地方

          數據供應

          閱讀排行榜

          評論排行榜

          [javaScript]javaScript檢測瀏覽器以及版本的粗略做法

           1var ua = navigator.userAgent.toLowerCase();
           2var isOpera=ua.indexOf("opera"> -1;
           3if(!isOpera)
           4    {
           5
           6        if(isIE)
           7        {
           8            var isMaxthod =  ua.indexOf("maxthon"> -1;
           9            if(isMaxthod)
          10            {
          11            alert('您使用的瀏覽器是Maxthod,為了順利體驗本系統,建議您停用浮動廣告過濾等Maxthod特有功能。');
          12            }

          13        }
          else
          14        {
          15            var isFF3 =  ua.indexOf("firefox/3"> -1;
          16            if(isFF3)
          17            {
          18            alert('瀏覽器','您使用的瀏覽器是FireFox3,為了順利體驗本系統,建議您使用IE6,IE7,Maxthod或FireFox(3.0以下)等瀏覽器。');
          19            }

          20    
          21        }

          22
          23            
          24    }

          25    else
          26    {
          27        alert('瀏覽器','您使用的瀏覽器是Opera,為了順利體驗本系統,建議您使用IE6,IE7,Maxthod或FireFox(3.0以下)等瀏覽器。');
          28    }


          Let life be beautiful like summer flowers and death like autumn leaves.

          posted on 2008-07-12 22:07 Alexwan 閱讀(307) 評論(0)  編輯  收藏 所屬分類: JavaScript小筆記

          主站蜘蛛池模板: 江津市| 阜平县| 通化市| 鄱阳县| 秦皇岛市| 府谷县| 永修县| 丹巴县| 马公市| 莆田市| 仪陇县| 若尔盖县| 勐海县| 都安| 门头沟区| 江山市| 沁源县| 河曲县| 陵川县| 宁夏| 铅山县| 含山县| 吴桥县| 宝坻区| 司法| 邓州市| 锡林浩特市| 绍兴县| 山西省| 临澧县| 东港市| 布尔津县| 渝中区| 五常市| 崇左市| 景谷| 乌拉特中旗| 汕尾市| 丹巴县| 芷江| 阿拉善左旗|