利用IE浏览器特有的一个属性 document.uniqueID 来判断:
if(document.uniqueID != document.uniqueID){
// current browser is ie
}
else{
// current browser is not ie (moz, opera ...)
}
方法分析:document.uniqueID 属性每次被访问时都会返回基于页面的一个唯一ID(类似于access里面的autonumber),所以其他非IE浏览器里面就算是DOM污染占用了此变量,也都不会具有IE下的这个特性