1.按id取得对象
function $(id){
return document.getElementById(id);
}
2.创建XmlHttpRequest对象
function createXmlHttpRequest (){
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){};
try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){};
try{return new XMLHttpRequest();}catch(e){};
alert("XmlHttpRequest not supported!");
return null;
}
