Well, my problem is that I want to get the data of the 'function success: function(json)
', the problem is that it does not read it ... What's wrong?
$('#chat-form').on('submit', function(event){
event.preventDefault();
$.ajax({
url : '/post/',
type : 'POST',
data : { msgbox : $('#chat-msg').val() },
dataType: 'json',
success : function(json){
$('#chat-msg').val('');
$('#msg-list').append('<li class="text-right list-group-item">' + json.msg + '</li>');
var chatlist = document.getElementById('msg-list-div');
chatlist.scrollTop = chatlist.scrollHeight;
}
}); });