php
[ajax] html문서의 결과값을 받아오는 ajax 예제
동동(이재동)
2008. 10. 7. 14:53
<script>
var url="http://172.16.10.50/zbxe/addons/dams_addon/test.php";
var xmlhttp = null;
if(window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open('GET', url,false);
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState==4 && xmlhttp.status == 200 && xmlhttp.statusText=='OK') {
responseText = xmlhttp.responseText;
}
}
xmlhttp.send('');
responseText = xmlhttp.responseText;
alert(responseText);
</script>