getWindow与isWindow

 
      var getWindow = function(obj) {
        var winProp = !+"\v1" ? 'parentWindow' : 'defaultView';
        return obj[winProp] || (obj.ownerDocument && obj.ownerDocument[winProp]) || obj;
      }
      var isWindow = function(obj){
        return obj.document && obj.document.nodeType === 9 ||
          obj.contentDocument && obj.contentDocument.nodeType === 9
      }
原文地址:https://www.cnblogs.com/rubylouvre/p/1631259.html