There is a request for some information:
<script type="text/javascript"> setInterval(function() { $.getJSON('/test.php', function(data) { alert(data.num); // Π½Π΅ΠΊΠΈΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ }); }, 2000); </script>
For the sake of interest, if 5 identical values fall out in num (for example, alert (1) drops out 5 times), then 4 needs to be deleted and output 1. And all this in JS.