I am writing out a hierarchical set of elements to the DOM document using JavaScript and am debugging using FireBug on FireFox 20.0. Based upon what I see when examining the DOM using FireBug, it seems that the writing out is going fine. The part of interest has the following structure.
childNodes NodeList[ulcorner, lrcorner]
- 0 ulcorner
accessKey ""
accessKeyLabel""
- attributes [xcoord="134", ycoord="49"]
+ 0 xcoord="134"
+ 1 ycoord="49"
However, when I call
var ulCorner=upperElement.getElementsByTagName("ulCorner")[0];
top=ulCorner.getAttribute("yCoord");
left=ulCorner.getAttribute("xCoord");
console.log('top=' + top + ', left=' + left);
I get
top=[object Window], left=134
Why is top set to [object Window] instead of 49?
<elephant />:-)XMLSerializer, see developer.mozilla.org/en-US/docs/Parsing_and_serializing_XML