아작스질문..
/* Ajax 부분 */
function fn_VIEW(idx, URL, callback){
$.ajax({
type : "POST",
url : (baseURL + URL),
data : {"idx" : idx},
//dataType : "json",
//contentType : "application/x-www-form-urlencoded;charset=UTF-8",
success : function(data){
alert(data);
}
});
}
/* Controller */
public function getContent(){
$idx = $this->input->post('idx', true);
$data['CONTENT'] = $this->notice_dao->getContent($idx);
$this->load->view('notice/notice_C', $data);
}
/* Model */
function getContent($idx){
$sql = 'SELECT
NOTCNT
FROM NOTICE
WHERE IDX = ?';
return $this->db->query($sql, $idx)->result();
}
흠.. 아작스부분에서 alert로 출력되는 값은 "Array"네요... 안에 데이터는 전혀 다른건데말이죠.. ㅜㅜ
그리고 alert보다 console.log()를 사용하셔서 개발자도구(firebug 또는 웹킷 개발자도구)에서
결과물을 확인해보시는게 보다 편하실거에요.