화요일, 11월 22, 2005

ajax 간단 샘플

var xmlhttp = null;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(E) {
xmlhttp = false;
}
}

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

var url;
url = "http://192.1.5.252/adminmail/userinfo.jsp?path=" + path;

xmlhttp.open("GET", url, false); // synchronous call
xmlhttp.send(null);

userinfo.innerText = xmlhttp.responseText;

댓글 없음: