1)
说我在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
如何返回每个ActiveXObject的类型,即Msxml2.DOMDocument.6.0
,Msxml2.DOMDocument.3.0
?我想观察xmlDoc的ActiveXObject
是否等于xmlDoc2' s ActiveXObject
。
2)
// object XMLDocument
var xmlObj = document.implementation.createDocument ("", "", null);
typeof xmlObj; // returns object
与ActiveXObject相同的情况,除了此对象定义为XMLDocument
。我怎样才能验证它是XMLDocument
?同样,typeof
会返回 object ,这在这里并不实用。
非常感谢。