历史难题,已经卡了一天了,求大神帮忙呀

在ie6下这段代码不能执行,会报错object expected。ie7,8,9 火狐,谷歌都可以执行
function submitResult(result) {
var xmlHttp = getXmlHttp();
xmlHttp.open('POST', 'ResultCollect.ashx', true);
xmlHttp.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
xmlHttp.send(obj2str(result));
}
function getXmlHttp() {
alert("dddd");
if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
else // code for IE6, IE5
return new ActiveXObject('Microsoft.XMLHTTP');
}

先顶一下 什么情况 有人吗

function createXMLHttpRequest(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}
else if(window.ActiveXObject){
try{
return new ActiveXObject("Msxml2.XMLHTTP");

}catch(e){
try{
return new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
alert(“您的浏览器不支持ajax!”);
return false;
}
}
}
}
只是从其他地方搬来的,不能解释你的问题,但是可能能够解决你的问题。