hi all,
Im having a a few javascript gremlins, for some reason my jquery ajax post request is not going out at all. All of my code 'looks' ok, but javascript is not my strong point, can anybody see where im going wrong?
$(".deleteWeek").click(function(e){
var answer = confirm("This will delete the selected week. Are you sure?");
if(answer){
$.ajax({
type: 'POST',
url: 'http://localhost/todo/index.php/home/ajax_delete',
data: { page_id : $(this).attr('id') },
success: tableRedraw(data),
dataType: 'html'
})
}
e.preventDefault();
})
and if it helps, my tableRedraw function:
function tableRedraw(data){
$('.week').remove(),
$('thead').after(data)
}
my click event is definitely being registered, i can put alerts in handler and they come up alright, but as far as firebug is concerned, there is nothing happening on the ajax side. Any help would be hugely appreciated.