Mindon.IDEA

Air off, Mind on ~ / Javascript+Golang, Sci, Health… /

精确识别IE6

BlogMS original blog key: 1002727130, blog id: airoff History stat: 浏览/评论:60/0 , 日期:2010年1月20日 13:25

麦盾方案

var ieo = document.createElement('div');

ieo.innerHTML = "<!--[if lte IE 6]><br/><![endif]-->";

var iec = ieo.childNodes[0];

var ie6 = (iec && iec.nodeType==1);

其它的方案都基本上都会发生失误。

[UPDATED] Conditional comments are no longer supported to Internet Explorer 10 and later. http://msdn.microsoft.com/en-us/library/ie/hh801214%28v=vs.85%29.aspx

Comments