function isHostMethod(object, property) {
var t = typeof object[property];
return t == ’function’ || (!!(t==’object’ && object[property])) || t == ’unknown’;
}
主要是考虑到浏览器兼容性,在ie8之前dom方法返回object,ie专有对象ActiveXObject一些方法会返回 unknown
function isHostMethod(object, property) {
var t = typeof object[property];
return t == ’function’ || (!!(t==’object’ && object[property])) || t == ’unknown’;
}