iexmldomexample.htm

来自「这是javascript高级程序设计的源码」· HTM 代码 · 共 36 行

HTM
36
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
    <head>
        <title>IE XML DOM Example</title>
    </head>
    <body>
<script type="text/javascript">
function createXMLDOM() {

    var arrSignatures = ["MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0",
                         "MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument",
                         "Microsoft.XmlDom"];
                         
    for (var i=0; i < arrSignatures.length; i++) {
        try {
        
            var oXmlDom = new ActiveXObject(arrSignatures[i]);
            
            return oXmlDom;
        
        } catch (oError) {
            //ignore
        }
    }              
    
    throw new Error("MSXML not installed on your system.");           
}

var oXmlDom = createXMLDOM();

</script>
     <p>This example simply tests to see if you have MSXML installed on your machine. If you don't, you'll see an error. If you do, you'll see nothing. </p>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?