ajax 데이터 전송 질문좀 드릴게요
본문
<script>
var arr = new Array();
arr[0] = "<?php echo $response->list[$i]->tid ; ?>";
arr[1] = "<?php echo $response->list[$i]->trdate ; ?>";
arr[2] = "<?php echo $response->list[$i]->trserial ; ?>";
arr[3] = "<?php echo $response->list[$i]->trdt ; ?>";
arr[4] = "<?php echo $response->list[$i]->accIn ; ?>";
arr[5] = "<?php echo $response->list[$i]->accOut ; ?>";
arr[6] = "<?php echo $response->list[$i]->balance ; ?>";
arr[7] = "<?php echo $response->list[$i]->remark1 ; ?>";
arr[8] = "<?php echo $response->list[$i]->remark2 ; ?>";
arr[9] = "<?php echo $response->list[$i]->remark3 ; ?>";
arr[10] = "<?php echo $response->list[$i]->remark4 ; ?>";
arr[11] = "<?php echo $response->list[$i]->regDT ; ?>";
arr[12] = "<?php echo $response->list[$i]->memo ; ?>";
var json_data =
{
"tid" : arr[0],
"trdate" : arr[1],
"trserial" : arr[2],
"trdt" : arr[3],
"accIn" : arr[4],
"accOut" : arr[5],
"balance" : arr[6],
"remark1" : arr[7],
"remark2" : arr[8],
"remark3" : arr[9],
"remark4" : arr[10],
"regDT" : arr[11],
"memo" : arr[12]
};
json_data = JSON.stringify(json_data);
$.ajax({
url:"http://localhost/theme/gram/mobile/api.php",
method:"POST",
data: {
arr_ : arr,
json_ : json_data
}
});
리스트를 ajax 로 넘겨서 insert 시키고 싶은데
값이 입력이 안되네여 ㅠㅠ
!-->
답변을 작성하시기 전에 로그인 해주세요.