如何实现 浏览器版本低 弹出错误页面_html/css_WEB-ITnose

WBOY
發布: 2016-06-24 12:06:35
原創
1058 人瀏覽過

像网易的云课堂那样浏览器低于某一版本就转到错误页面,用if lt IE 8之类的能实现么


回复讨论(解决方案)

js检测useragent来判断客户端浏览器版本

例如,检测IE

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x; var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number if (ieversion>=9)  document.write("You're using IE9 or above") else if (ieversion>=8)  document.write("You're using IE8 or above") else if (ieversion>=7)  document.write("You're using IE7.x") else if (ieversion>=6)  document.write("You're using IE6.x") else if (ieversion>=5)  document.write("You're using IE5.x")}else document.write("n/a")
登入後複製

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!