js 兼容ff activexobject创建xmlhttp方法
*/
function createxmlhttpobject()
{
var xobject = null;
try
{
xobject = new activexobject("msxml2.xmlhttp.4.0");
}
catch (e)
{
try
{
xobject = new xmlhttprequest();
if(xobject.overridemimetype){
xobject.overridemimetype('text/xml');
}
}
catch (e)
{
try
{
xobject = new activexobject("msxml2.xmlhttp");
}
catch (e)
{
try
{
xobject = new activexobject("microsoft.xmlhttp");
}
catch (e)
{
alert("error: unable to create xml http object!");
}
}
}
}
return xobject;
}
function initrequest(){
request = createxmlhttpobject();
}
时间: 2024-10-14 12:14:48