Skip to content

Instantly share code, notes, and snippets.

@kpozin
Created January 14, 2011 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpozin/779141 to your computer and use it in GitHub Desktop.
Save kpozin/779141 to your computer and use it in GitHub Desktop.
isDisconnected
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
@kpozin
Copy link
Author

kpozin commented Jan 14, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment