//Peter Michaux
    function isHostMethod(object, property) {
        var t = typeof object[property];
        return t == 'function' ||
            (!!(t == 'object' && object[property])) ||
                t == 'unknown';
    }

    result = isHostMethod(xhr, "open"); //true
    result = isHostMethod(xhr, "foo"); //false

 

posted on 2012-07-30 15:58  baby_tao  阅读(506)  评论(0编辑  收藏  举报