六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 51|回复: 0

正确使用不同版本的MSXML

[复制链接]

升级  60%

6

主题

6

主题

6

主题

童生

Rank: 1

积分
30
 楼主| 发表于 2013-1-15 03:00:41 | 显示全部楼层 |阅读模式
http://www.cnblogs.com/mjgforever/archive/2007/08/31/877076.html

前言
        微软有很多MSXML的版本,如Msxml2.DOMDocument.6.0、Msxml2.DOMDocument.5.0、Msxml2.DOMDocument.4.0等。在浏览器中如何运用这些版本显得非常必要。
        常见的错误用法:
<div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; width: 98%; padding-top: 4px; background-color: #eeeeee; border: #cccccc 1px solid;">
if (Web.Application.get_type() == Web.ApplicationType.InternetExplorer) {

        
var progIDs = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.5.0', 'Msxml2.DOMDocument.4.0', 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ]; // MSXML5.0, MSXML4.0 and Msxml2.DOMDocument all have issues - be careful when using.  Details below.

        

        
for (var i = 0; i < progIDs.length; i++) {

            
try {

               
var xmlDOM = new ActiveXObject(progIDs);

               
return xmlDOM;

            }


            
catch (ex) {

            }


        }


        

        
return null;

       }

您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表