My server "return HttpResponse()" when succuess, "return HttpResponse(status=400)" when failed. My client has following jquery ajax function:
$('#submit').click(function(){
$.post("{% url 'addcomment' %}", {msg:$('#newcomment').val()}, function(data,status){
if (status==200) {
location.reload()
} else {
alert("Comment failed")
}
});
});
But the ajax code doesn't work. Any idea?