I have a number of items on a page, each has a delete <div id = “delete_question”></div>, when clicked it calls an $.ajax function to delete the selected item. For some reason it only works for the first item, if I try to delete the second item nothing happens - I am checking with Firebug and no action is sent by jquery…
$(function() {
var question_id = $('#question_id_hidden').val();
$('#delete_question').click(function() {
$.ajax({
url: '<?php echo base_url();?>index.php/knowledge/delete',
type:"POST",
data:{'question_id':question_id},
success: function() {
window.location.reload(true)
} //end success
});
});
});