hi all, i have an unusual javascript problem, i have a javascript problem that alternately refuses to work. Basically, on the first click, the jquery function works as it should, deleting the table row, and redrawing the table rows:
$(".deleteRow").click(function(e){
if(confirm("This will delete the selected week. Are you sure?")){
$.ajax({
type: 'POST',
url: 'http://localhost/todo/index.php/home/ajax_delete',
data: { page_id : $(this).attr('id') },
success: tableRedraw,
dataType: 'html'
})
};
e.preventDefault();
})
however, if i click the button that triggers this again, it doesnt work. Instead of going through the javascript function, it follows the link (designed for non javascript mode). I cant understand this unusual behaviour, i might have thought that it was caused by the jquery source not being available (for some unknown reason) but i have another function that adds rows to the table, that can be used many times in succession with no problems:
$("#addRow").click(function(e){
$.ajax({
type: 'POST',
url: 'http://localhost/todo/index.php/home/ajax_add',
success: tableRedraw,
dataType: 'html'
})
e.preventDefault();
})
})
any help would be hugely appreciated.