用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3134|回复: 1
收起左侧

[HELP] $.ajax提交时怎么获取这个id数组的数据

[复制链接]
发表于 2012-7-31 16:59:25 | 显示全部楼层 |阅读模式
        var aid=<?php echo $data['activity_id'];?>;
        var mtype=$('#mtype').val();
        var mstate=$('#mstate').val();
        if(arr.length>0)
        {
            $.ajax({
                type:"POST",
                url:"/activityact/allowAllState/",
                data:{ids:arr,acid:aid,type:mtype,state:mstate},
                success:function(msg){
                    if(msg=='true'){
                            window.location.reload();
                    }
                }
            });
        }
后台怎么接收ids的数据为什么我删除时只是执行了最后一条数据呢
$ids=$this->input->post('ids');

发表于 2012-8-1 11:10:35 | 显示全部楼层
将数组的内容拼接成字符串,以逗号隔开。
在后台取出来这个字符串,做拆分。

本版积分规则