질문Q #3014
ajax json 사용 문의 합니다.
citests2014-12-23 21:49:39
view 파일에서
var data = {'idx[]': rowIds, mode: 'OW'};
            $.ajax({
                dataType: 'text',
                url: '/index.php/mul/mulview/',
                data: data,
                type: 'POST',
                success: function (data, status, xhr) {                   
                    window.open('/index.php/mul/mulview', 'ajaxtest', 'width=420, height=370, toolbar=, menubar=no, scrollbars=yes, resizable=no');
                }
            });
이런식으로보냈습니다.

mul/mulview/' 컨트롤러에서 데이터를 어떻게 받아야 하는지
json_encode, json_decode 로도 안되고 $_POST 로도 출력이 안되네요.
파이어폭스 콘솔에는 아래 처럼 출력이 됩니다.
Array
(
    [0] => Array
        (
        )

)
Array
(
    [0] => 4899
    [1] => 4821
)
컨트롤러에서 어떻게 받아야 하는지 고수 님들 도움 부탁 합니다.
수고하세요..



 
답변1
#1 변종원(웅파) 2014-12-23 22:09:39
post로 보내셨으니 $this->input->post(null, true) 로 받으시면 됩니다.
위 내용을 보니 데이터type은 text인데 배열로 넘기시네요.  1,2,3,4 형태로 넘기세요.
ajax 매뉴얼 다시 참고하세요.