I have some code, which was written couple of years ago and works only in IE. I would like, to make it work with browser now.
So, code receives XML by XHR, and then reading its content. And I have a "collection" of elements. In FF it type is Element, in IE is IXMLDOMElement. To make reading text value unified (FF uses textContent property, IE text) I want to add method like this:
Element.prototype.getText = function() {
return this.text || this.textContent;
}
But, when I try to do this in IE with IXMLDOMElement instead of Element, then I get error (in IE), that IXMLDOMElement is not defined. How something cannot be defined, if it's that type? (checked in IE's development tools)
Can anybody give me any advice, hint how to deal with this?