得到XmlHttpRequest对象封装的函数,支持ie和firefox
<script>
function createXMLHttp()
{
var ret = null;
try {
ret = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e) {
try {
ret = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (ee) {
ret = null;
}
}
if (!ret && typeof XMLHttpRequest != 'undefined')
ret = new XMLHttpRequest();
return ret;
}
</script>