Web Programings/Ajax (2) 썸네일형 리스트형 [AJax] Json 디코딩 View 단에서 작업 (html) 표준적인 방법 $.ajax({ type: 'POST', url: '/some/resource', success: function(data, textStatus) { // Handle success }, error: function(xhr, textStatus, errorThrown) { // Handle error } }); Controller 단에서 작업 (php) $rs[0]['title']="배우는 재미"; $rs[1]['title']="노는 재미"; echo json_encode($rs); // $rs는 결과값으로 Array 형태로 전달 [AJax] 값 전송 양식 ============================================= 사용자에게 보이는 html/php단에서의 스크립트 ============================================= ============================================= 사용자측에서 보내온 Ajax 값을 서버측에서 처리하여 결과값을 보내는 부분 ============================================= function nickNameCheckAjaxAction(){ // AjaxHeader를 설정 header("Content-Type: text/html; charset=UTF-8"); header("Cache-Control: no-cache"); heade.. 이전 1 다음