实际上哪些版本的浏览器可以命名为现代?哪里支持css3和更多或更少的现代功能?
谢谢!
function isOldBrowser() {
var isOld = false;
var detect = function(){
var ua= navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i) || [];
if(/trident/i.test(M[1])){
tem= /\brv[ :]+(\d+(\.\d+)?)/g.exec(ua) || [];
return 'IE '+(tem[1] || '');
}
M = M[2] ? [M[1].toLowerCase(), parseInt(M[2],10)] : [navigator.appName.toLowerCase(), parseInt(navigator.appVersion,10), '-?'];
if((tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
return M;
};
var browser = detect();
if (document.all && !document.querySelector) isOld = true; //IE7 or lower
else if (document.all && document.querySelector && !document.addEventListener) isOld = true; //IE8
else if (browser[0] == 'firefox' && browser[1] < 4) isOld = true; //FF4+
else if (browser[0] == 'safari' && browser[1] < 5) isOld = true; //Safari 5+
return isOld;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1875 次 |
| 最近记录: |