window.logs = function(){ if(console){if(typeof console.log.apply != ‘unknown‘){ //IE 11下的9 10 11,W3C系列; console.log.apply(console,arguments); }else{ //IE 11下的IE8 } } }
在IE11下的IE8模式,console.log开发者工具下能使用,但是使用apply就不行,显示为unkonwn,根据这个进行判断是否在IE11的IE8模式;
apply(console,arguments);console是浏览器下的一个对象,所以要调用console对象
原文:http://www.cnblogs.com/strangerqt/p/4358142.html