달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'XMLHttpRequest'에 해당되는 글 1건

  1. 2013.11.20 AJAX Call 기본 형태..

순수.. 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
Posted by 행복한삶~!!
|