You are on page 1of 1

<div id="chat-messages">

<div class="message">
<img src="https://s3-us-west-
2.amazonaws.com/s.cdpn.io/245657/1_copy.jpg" />
<div class="bubble">
Really cool stuff!
<div class="corner"></div>
<span>3 min</span>
</div>
</div>

<div class="message right">


<img src="https://s3-us-west-
2.amazonaws.com/s.cdpn.io/245657/2_copy.jpg" />
<div class="bubble">
Can you share a link for the tutorial?
<div class="corner"></div>
<span>1 min</span>
</div>
</div>

</div>

<script>
function showCustomer(str) {
var xhttp;

setInterval(function timer() {
if (str == "") {
document.getElementById("chat-messages").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("chat-messages").innerHTML = this.responseText;
}
};
xhttp.open("GET", "php/functional/chat_action.php?q="+str, true);
xhttp.send();

}, 1000);
}

</script>

You might also like