0
In this script below it keeps updating the div and showing a counter
What I wanted is that if there is any change in the number, playing a Sound "An Alarm" only that I have no knowledge of javascript if someone can help me will help me a lot
counter_map.php
$sql1 = "SELECT COUNT(*) AS total1 FROM agenda_saidas where id_transfer1 = '1' ";
$resultado1 = mysql_query($sql1) or die ("Erro na consulta1");
$linha1 = mysql_fetch_assoc($resultado1);
$cancel_solicitado = $linha1['total1'];
List.php
<div id="latestData"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(function () {
function getContadorMapa() {
$.get("includes/principal/contador_mapa.php", function (result) {
$('#latestData').html(result);
});
}
getContadorMapa();
setInterval(getContadorMapa, 20000);
});
</script>
Almost... more I wanted when a new number arrived there yes play sound
– Fabio Henrique
Suffice it to compare,
$('#latestData').html() != result){ // .play() // }
, without the HTML of the page it is a little difficult to know how the elements are inserted, but generically this is it.– Inkeliz