Professional Documents
Culture Documents
Chat Message
Chat Message
<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>
<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>