This is my code. I want to pass Id to use in the controller for delete
<button onclick="Delete(<?php echo $article->id; ?>)">Delete</button>
And this is function through which the id
is passed to the controller
<script type="text/javascript">
function Delete(id)
{
var conf=confirm('Are you want to delete');
if (conf)
{
$.ajax({
url:'admin/delet_data',
type:"post",
data:{dlt_id:id},
});
}
}
</script>
I want the id
in this function
public function delet_data()
{
echo $this->input->post('dlt_id'); exit;
}