code: function isDetached(node) {
          while (node = node.parentNode) {
              if (node.nodeType == 11) {
                  // it's a document fragment; we're detached (IE)
                  return true;
              }
              else if (node.nodeType == 9) {
                  // it's a normal document; we're attached
                  return false;
              }
          }
  
          // we didn't find a document; we're detached (most other browsers)
          return true;
      }
docs: Returns whether a node is detached from any live documents. Detached
  nodes should be considered invalidated and evicted from any caches.