var isIE = function(ver) { var b = document.createElement(‘b); b.innerHTML = ‘<!--[if IE ‘ + ver + ‘]><i></i><![endif]-->‘; return b.getElementsByTagName(‘i‘).length === 1; }; var ie = { ie6 : isIE(6), ie7 : isIE(7), ie8 : isIE(8), ie9 : isIE(9), ie10 : isIE(10) }; alert(‘ie6:‘ + ie.ie6 + ‘\n‘ + ‘ie7:‘ + ie.ie7 + ‘\n‘ + ‘ie8:‘ + ie.ie8 + ‘\n‘ + ‘ie9:‘ + ie.ie9 + ‘\n‘ + ‘ie10:‘ + ie.ie10 + ‘\n‘);
时间: 2024-10-23 18:24:11