create a php live chat without no load

Solutions on MaxInterview for create a php live chat without no load by the best coders in the world

showing results for - "create a php live chat without no load"
Sean
11 Jun 2017
1//Updates the chat
2function updateChat(){
3  $.ajax({
4
5    type: "GET",
6    url: "update.php",
7    data: {  
8        'state': state,
9        'file' : file
10        },
11    dataType: "json",
12    cache: false,
13    success: function(data) {
14
15        if (data.text != null) {
16            for (var i = 0; i < data.text.length; i++) {  
17            $('#chat-area').append($("<p>"+ data.text[i] +"</p>"));
18        }
19
20        document.getElementById('chat-area').scrollTop = document.getElementById('chat-area').scrollHeight;
21
22    }  
23
24    instanse = false;
25    state = data.state;
26    setTimeout('updateChat()', 1);
27
28    },
29  });
30}
31