Developement/Web
XMLHttpRequest객체 생성하기
highheat
2008. 7. 4. 11:49
var xmlHttp = false;
if(window.ActiveXObject){
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e2) {
xmlHttp = false;
}
}
}
if(!xmlHttp && typeof XMLHttpRequest != 'undefined'){
xmlHttp = new XMLHttpRequest();
}
if(window.ActiveXObject){
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e2) {
xmlHttp = false;
}
}
}
if(!xmlHttp && typeof XMLHttpRequest != 'undefined'){
xmlHttp = new XMLHttpRequest();
}