T.xmlHttpRequest.send(T.sendContent);在IE6下面测试完全正常,但到IE7下使用,如果将T.sendContent设置为一个固定值的话,就没问题T.xmlHttpRequest.send("3498745");
但是如果T.sendContent一旦变了,再请求,就会抛出T.xmlHttpRequest.send(T.sendContent);参数无效的错误,找了好几天了,不知道原因在哪儿,此为全部源码
function ajaxInfo(_url)
{
var T = this;

this.method = "GET";   //GET | POST | HEAD
this.url = (_url?_url:null);  //请求地址
this.asynch = true;   //异步
this.container= null;  //容器,接收返回的数据
this.loadFunc = null;  //正在载入调用
this.okFunc   = null;  //载入成功调用
this.errFunc  = null;  //载入失败调用
this.sendContent = null;   //send发送的内容
this.requestType = "TEXT";  //"TEXT" | "XML" | "ALLHEADER" | "HEADER"
this.contentType = null   //设置请求的: Content-Type
this.headerName  = null;    //请求的头部名称
this.xmlHttpRequest = null;   //保存XMLHttpRequest请求对象

//赋予T.xmlHttpRequest一个可用的httpXMLRequest对象
this.prepareXMLHttpRequest = function()
{
if(T.xmlHttpRequest)//T.xmlHttpRequest不为空,则直接重置后返回.
{   
T.xmlHttpRequest.abort();
return ;
}
if(ajaxInfo.prototype.XmlRequestArray.length>0) //有空闲的xmlRequest对象,取一个赋给T.xmlHttpRequest
{
T.xmlHttpRequest = ajaxInfo.prototype.XmlRequestArray.pop();
}
else //没有空闲的xmlRequest对象,建立一个赋给T.xmlHttpRequest
{
var objXMLHttp;
if (window.XMLHttpRequest)
{
    objXMLHttp = new XMLHttpRequest();
}
else
{ var MSXML=['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
for(var n = 0; n < MSXML.length; n ++)
{
try { objXMLHttp = new ActiveXObject(MSXML[n]); break; }
catch(e){}
}
}
T.xmlHttpRequest = objXMLHttp;
}
T.xmlHttpRequest.abort();//重置
} //根据请求类别,填充数据
this.fill = function()
{
if(T.requestType=="XML")
{
T.container= T.xmlHttpRequest.responseXML;
}
else if(T.requestType=="TEXT")
{
T.container = T.xmlHttpRequest.responseText;
}
else if(T.requestType=="ALLHEADER")
{
T.container = T.xmlHttpRequest.getAllResponseHeaders();
}
else if(T.requestType=="HEADER")
{
T.container = T.xmlHttpRequest.getResponseHeader(T.headerName);
}
else
{
T.container = "不支持的请求类型.";
}
}

//发送请求,填充T.container,可以带一个url参数.
this.get = function (_url)
{
if(T.xmlHttpRequest && ajaxInfo.prototype.useTime<ajaxInfo.prototype.timeOut)
{
setTimeout(function(){T.get(_url)},100);
ajaxInfo.prototype.useTime+=100;
return;
}
ajaxInfo.prototype.useTime = 0;
T.url = _url || T.url;
if(T.url=="" || T.url==null)
{ //确保有请求地址,可根据需要修改,弹出错误提示或抛出异常?
alert(ajaxInfo.prototype.NoUrl); 
return;
}
T.prepareXMLHttpRequest();
if(!T.xmlHttpRequest)
{ //确保建立请求对象,根据需要修改,弹出错误提示或抛出异常?
alert(ajaxInfo.prototype.NoXMLHttpRequest); 
return;
} if(T.asynch) 
{ //设置异步操作
T.xmlHttpRequest.onreadystatechange = function()
{ switch (T.xmlHttpRequest.readyState)
{
/* 0 - (未初始化)还没有调用send()方法
1 - (载入)已调用send()方法,正在发送请求
2 - (载入完成)send()方法执行完成,已经接收到全部响应内容
3 - (交互)正在解析响应内容
4 - (完成)响应内容解析完成,可以在客户端调用了
*/
case 0:
case 1:
case 2:
case 3:
if(T.loadFunc)

T.loadFunc(T.xmlHttpRequest.readyState); 
}
break;
case 4:
if(T.xmlHttpRequest.status==200)
{
T.fill();
if(T.okFunc)
{
T.okFunc(T.xmlHttpRequest.status);   
}
}
else
{
if(T.errFunc)
{
T.errFunc(T.xmlHttpRequest.status); 
}
}
//回收XmlRequest对象
ajaxInfo.prototype.XmlRequestArray.push(T.xmlHttpRequest);
T.xmlHttpRequest = null;
break;
default:
alert("未处理状态.");
break;
}
}
}

T.xmlHttpRequest.open(T.method,T.url,T.asynch);//发送请求
if(T.contentType)
{
T.xmlHttpRequest.setRequestHeader("Content-Type", T.contentType);
}
if(T.sendContent != 0)
{
alert(T.sendContent);
T.xmlHttpRequest.send(T.sendContent);
}
if(!T.asynch)//同步请求操作(兼容firefox,firefox在同步的情况下无法正常调用onreadystatechange设定的函数)
{
T.fill();
ajaxInfo.prototype.XmlRequestArray.push(T.xmlHttpRequest);
//回收XmlRequest对象
T.xmlHttpRequest = null;
}
}
}
ajaxInfo.prototype.NoXMLHttpRequest = "您的浏览器不支持XMLHttpRequest,请升级浏览器以便正常访问";
ajaxInfo.prototype.NoUrl = "请求地址为空,操作失败.";//用于POST数据时,将 o.contentType = ajaxInfo.prototype.ContenTypeForm, 这个太长了,不好记,当作常量放在这里 :) 
ajaxInfo.prototype.ContenTypeForm = "application/x-www-form-urlencoded"; 
ajaxInfo.prototype.timeOut = 5000;//超时时间
ajaxInfo.prototype.useTime = 0;   //耗时
ajaxInfo.prototype.XmlRequestArray = new Array(); //保存空闲的HttpXMLRequest对象,以便复用跪求高手赐教!