I'm looking for documentation on jsdom that is more descriptive than just the readme at https://github.com/tmpvar/jsdom.
我正在寻找关于jsdom的文档,它比https://github.com/tmpvar/jsdom上的自述文件更具描述性。
Specifically, I'm looking for instructions on how to interpret the nodeType property of a DOM node created by jsdom. The property stores an integer which has no inherent meaning as far as I can see. In the immediate example I'm sure there's some testing I can do to discover what integer maps to what DOM node type, but it's taking a long time to write custom tests and introspection code just to work my way around these objects. Other questions that I'd use the doc for are about how to access a node's parent directly, traverse children, access text data, etc. (all by accessing object properties directly outside of any jquery specific functions).
具体来说,我正在寻找有关如何解释由jsdom创建的DOM节点的nodeType属性的说明。该属性存储一个整数,就我所见,它没有固有的含义。在最近的例子中,我确信我可以做一些测试来发现什么整数映射到DOM节点类型,但是编写自定义测试和内省代码需要花费很长时间才能绕过这些对象。我使用doc的其他问题是如何直接访问节点的父节点,遍历子节点,访问文本数据等(所有这些都是通过直接访问任何jquery特定函数之外的对象属性)。
Where can I find jsdom documentation on the properties of a DOM node?
我在哪里可以找到有关DOM节点属性的jsdom文档?
1 个解决方案
#1
0
While not specific to jsdom, the NodeTypes - Named Constants table at http://www.w3schools.com/dom/dom_nodetype.asp seems to relate to the values I'm seeing for nodeType values.
虽然不是特定于jsdom,但是http://www.w3schools.com/dom/dom_nodetype.asp上的NodeTypes-Named Constants表似乎与我在nodeType值中看到的值有关。
#1
0
While not specific to jsdom, the NodeTypes - Named Constants table at http://www.w3schools.com/dom/dom_nodetype.asp seems to relate to the values I'm seeing for nodeType values.
虽然不是特定于jsdom,但是http://www.w3schools.com/dom/dom_nodetype.asp上的NodeTypes-Named Constants表似乎与我在nodeType值中看到的值有关。