【发布时间】:2011-04-12 00:00:26
【问题描述】:
我正在使用 jquery 对表进行删除,
$('table#chkbox td a.delete').click(function()
{
if (confirm("Are you sure you want to delete this row?"))
{
var id = $(this).parent().attr('id');
var parent = $(this).parent().parent();
$.ajax(
{
type: "POST",
url: "<?php echo base_url().'index.php/libraryController/librarydelete' ?>",
data: { 'id': id },
cache: false,
success: function()
{
parent.fadeOut('slow', function() {$(this).remove();});
}
});
}
});
我正确获取了 id 值,但我的数据参数没有传递给我的控制器,
function librarydelete($id)
{
$del = $id;
echo $del;
$this->librarymodel->deletebook_issue($id);
$this->session->set_flashdata('response','Deleted successfully');
redirect('libraryController/loadmagazinedetails');
}
任何建议...
我收到了错误,
Missing argument 1 for libraryController::librarydelete() 和 Undefined variable: id
【问题讨论】:
标签: php jquery codeigniter parameter-passing