我有一些javascript的gremlins,由于某种原因,我的jquery ajax发布请求根本不会出去。我所有的代码看起来都很好,但是javascript并不是我的强项,任何人都可以看到我的错在哪里?jquery不会提交ajax发布请求
$(".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();
})
,如果有帮助,我tableRedraw功能:
function tableRedraw(data){
$('.week').remove(),
$('thead').after(data)
}
我的点击事件肯定是被注册的,我可以把处理器警报和他们拿出好的,但据萤火虫关注,阿贾克斯方面没有任何发生。任何帮助将非常感激。