I can not call a javascript function

0

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;
        }
    });     });
    
asked by Gerson 23.01.2017 в 19:16
source

1 answer

1

Dear, the url does not go to any server page. You are only checking which folder, but you do not address it to a specific file. Greetings!

    
answered by 30.03.2017 в 17:50