순수.. XMLHttpRequest 객체를 사용하여 ajax call 할때..
jQuery 나 prototype 사용하면.. 인터페이스가 다르다..
하지만... 그 내부를 까보면.. 아래와 같은 코드가 있다는거..
function ajaxUpdateServerVariable() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } // success 일때 호출되는 call back xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //update success //alert( xmlhttp.responseText ); } } xmlhttp.open("GET","target_url.jsp?param=xxxx",true); xmlhttp.send(); }
'FrontEnd > JavaScript' 카테고리의 다른 글
window, frames, window.top 이해하기.. (0) | 2013.11.20 |
---|---|
같은 이름을 갖는...element들을 배열로 얻어와서 다루기.. (0) | 2013.11.20 |
JSON 데이타 다루기.. (0) | 2013.11.20 |
Javascript study.. (0) | 2013.11.12 |
object 선언 (0) | 2013.10.31 |