0

1)

Say I have the following in JavaScript:

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
var xmlDoc2 = new ActiveXObject("Msxml2.DOMDocument.3.0");
var xmlDoc3 = new ActiveXObject("Microsoft.XMLDOM");

typeof xmlDoc;  // returns object
typeof xmlDoc2; // returns object
typeof xmlDoc3; // returns object

How do I return the type of ActiveXObject of each one, i.e. Msxml2.DOMDocument.6.0, Msxml2.DOMDocument.3.0? I want to observe if xmlDoc's ActiveXObject is equal to xmlDoc2's ActiveXObject.

2)

 // object XMLDocument
 var xmlObj = document.implementation.createDocument ("", "", null); 
 typeof xmlObj; // returns object

Same situation as ActiveXObject, except this object is defined as XMLDocument. How would I be able to validate that it is XMLDocument? Again, typeof returns object, which is not really helpful here.

Thank you very much.

user3621633
  • 1,681
  • 3
  • 32
  • 46

0 Answers0