console.log("Begin 12-2");
var HTTPCtrl =
{
getHTTP: function()
{
var xmlhttp= null;
if(window.XMLHttpRequest)
{
xmlhttp= new XMLHttpRequest();
}
else
{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
};
var request = HTTPCtrl.getHTTP();
request.open('get', '12-2_getResult.jsp', true);
request.send();
request.onreadystatechange = function()
{
var divElem= document.getElementById('loadingMessageContainer');
if(request.readyState === 4)
{
var msg= request.responseText;
var content = document.getElementById("loadingMessageContainer");
divElem.innerHTML= "서버로부터 받은 메세지<br/>" + msg;
}
else
{
divElem.style.display= '';
}
};
console.log("End 12-2");
'Programming > JavaScript' 카테고리의 다른 글
[Javascript] 12-3_XMLHttpRequestStatus.js (0) | 2016.12.09 |
---|---|
[JavaScript] 12-2_getResult.jsp (0) | 2016.12.09 |
[JavaScript] 12-1_XMLHttpRequestExam.jsp (0) | 2016.12.09 |
[JavaScript] 12-1_XMLHttpRequestExam.js (0) | 2016.12.09 |
[JavaScript] 12-0_XMLHttpRequest.html (0) | 2016.12.09 |