api的用途:获取目标元素所属的document对象。
1、ZYC.dom.g的代码详情在http://zhangyaochun.iteye.com/blog/1439262
2、ownerDocument ---返回某元素的根元素,此属性是只读的。
3、nodeType =9 文档节点
/*
*getDocument --get the document object that the target element belong to*
*@function*
*@param {HTMLElement|String} element*
*@return {HTMLElement}*
*/
ZYC.dom.getDocument = function(element){
element = ZYC.dom.g(element);
return element.nodeType == 9 ? element.ownerDocument : element.document
}
本文详细介绍了如何使用API获取目标元素所属的文档对象,包括文档节点的识别和ownerDocument属性的作用。
1484

被折叠的 条评论
为什么被折叠?



