可以使用下面的代码判断当前的浏览器的类型:
if ( !+ [1, ] ){
    alert("yes!") ;
} else {
    alert("no!") ;
}

在IE6~8的结果:yes!

ie9+或者其他浏览器的结果:no!