实际上哪些版本的浏览器可以命名为现代?哪里支持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 …Run Code Online (Sandbox Code Playgroud) 如果有什么方法可以测量文本节点的高度而不包裹它?
我尝试过无用的本机方法node.style.height,然后node.clientHeight是 jQuery 方法$(node).height()
它给了我 javascript 错误Uncaught TypeError: Cannot read property 'height' of undefined