//////////ОТОБРАЖЕНИЕ ИГРАКОВ////////////
$u = DB::getAll("SELECT * FROM `users` WHERE `loc` = '".$user['loc']."' and `id` != '".$user['id']."' and `cave` = '1' and `date_last` > '".(time()-120)."'");
foreach($u as $users) {
$zonas_inf = DB::getRow("SELECT * FROM users WHERE loc='".$user['loc']."' and x='".$x."' and x='".$users['x']."' and y='".$y."' and y='".$users['y']."'");
if(!empty($zonas_inf))
{
echo '<div class="outer">
<img src="/design/img/map/users/1.png" title="'.$users['login'].'" style="z-index:10;max-width: 100%" >
</div>';
}
}
///////////////////
setInterval(function() {
// Отправляем AJAX-запрос на сервер
var xhr = new XMLHttpRequest();
xhr.open('GET', '/update.php', true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// Обновляем содержимое страницы с помощью полученных данных
var response = xhr.responseText;
document.getElementById('players').innerHTML = response;
}
};
xhr.send();
}, 1000);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
let interval = setInterval(function () {
$.ajax('/abuba.php',{
method: "GET"
}).done(function (data) {
$('.divad').html(data);
});
}, 1000);
});
</script>