每一种美,都会有一双眼睛能看到;每一份爱,总会有一颗心会感受到。

判断浏览器类型和版本

//判断浏览器类型和版本

 

ie8及以下不能使用jquery2.0以上版本库,可采用以下方法判断

<!--[if lte IE 8]>
<script type="text/javascript">
alert('Warm tip: dear friend, your browser version is too low will affect your normal use of the system, please upgrade to the latest version of the browser and then browse, the system supports the following version of the browser:★ IE 9+ ★ Firefox 5+ ★ Chrome 14+ ★ Safari 5+ ★ Opera 11+');
</script>

 

      <script type="text/javascript"> 
         var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var s; (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0 if ( Sys.firefox < '5.0' || Sys.chrome < '14.0' || Sys.safari < '5.0' || Sys.opera < '11.0') { alert('Warm tip: dear friend, your browser version is too low will affect your normal use of the system, please upgrade to the latest version of the browser and then browse, the system supports the following version of the browser:★ IE 9+ ★ Firefox 5+ ★ Chrome 14+ ★ Safari 5+ ★ Opera 11+'); }//./
</script>

  

posted @ 2015-06-19 15:56  温暖向阳Love  阅读(273)  评论(0编辑  收藏  举报