Скрипт |
<ul class="menu">
<li class="active">
<a href="http://www.opentraders.ru/chat/">Чат</a>
<div class="sub-menu-wrapper">
<div class="sub-menu-box">
<div class="left-bg">
<div class="right-bg">
<ul class="sub-menu" >
<li class="active"><div><a href="http://www.opentraders.ru/chat/">Чат</a></div></li>
<li ><div><a href="http://www.opentraders.ru/chat/archive/">Архи в</a></div></li>
</ul>
</div>
</div>
</div>
</div>
</li>
setTimeout("updateChatAJAx()",2000);
Эта строка javascript будет вызывать функцию "updatechatAJAx" javascript каждые 2 секунды.
//Load the message View
function updateChatAJAx(){
var ajaxRequest; // The variable that makes Ajax possible!
ajaxRequest = new XMLHttpRequest();
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
//The response
document.getElementById('MoreID').innerHTML = ajaxRequest.responseText;
}
}
ajaxRequest.open("GET", "getMessages.php", true);
ajaxRequest.send(null);
}
14 ноября 2018
|
26 августа 2021
|
Комментарии (1)
его причешем по стилям и он будет открываться по умолчанию скоро у всех
45 Bishop Сообщений: 5710 - АЛЬФАХАМЕЦ-Машковод
Зарегистрируйтесь или авторизуйтесь, чтобы оставить комментарий