标签:不能 div name turn html 支持 检查 var log
//首先要对HTMLElement进行类型检查,因为即使在支持HTMLElement
//的浏览器中,类型却是有差别的,在Chrome,Opera中HTMLElement的
//类型为function,此时就不能用它来判断了
var isDOM = ( typeof HTMLElement === ‘object‘ ) ?
function(obj){
return obj instanceof HTMLElement;
} :
function(obj){
return obj && typeof obj === ‘object‘ && obj.nodeType === 1 && typeof obj.nodeName === ‘string‘;
}
标签:不能 div name turn html 支持 检查 var log
原文地址:http://www.cnblogs.com/zhujiasheng/p/6160300.html