ໂອບເອັມໂດມ ownerDocument
ການອະທິບາຍ ແລະ ການນໍາໃຊ້
ownerDocument ສາມາດຮັບຫົວໜ້າຂອງປະກອບ.
ຂອດຂອງພາສາ:
nodeObject.ownerDocument
ກໍລະນີ
ໃນທຸກກໍລະນີ, ພວກເຮົາຈະນໍາໃຊ້ເອັມໂດມ XML books.xml, ແລະ ພະລັງງານ JavaScript loadXMLDoc().
ການຂັດຂວາງລະຫັດຂອງ XML ທີ່ເປັນ ຫົວໜ້າ <title>:
xmlDoc=loadXMLDoc("books.xml");
var x=xmlDoc.getElementsByTagName("title")[0].ownerDocument
;
document.write("Nodename: " + x.nodeName);
document.write(" (nodetype: " + x.nodeType + ")");
Output:
Nodename: #document (nodetype: 9)