Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When node.ownerDocument is not window.document?

Tags:

javascript

dom

I'm looking at MDN and W3C resources to find out what exactly is ownerDocument and how it works?

As I tested in any condition node.ownerDocument == window.document. So when this property is not window.document?

Can you explain it?

like image 386
Mohsen Avatar asked Mar 23 '12 19:03

Mohsen


1 Answers

One way is if the node was obtained from an iframe or secondary browser window.

Another way is if it's a node from an XML document obtained from an HTTP source via AJAX.

like image 155
ruakh Avatar answered Nov 10 '22 01:11

ruakh