0
I am making a page and I need it updated constantly, but only when the value of an external page I called with the Jquery.get() function is different from the one already contained in the file, it follows my jquery code...
$(document).ready(function() {
setInterval(function()
{
$.ajaxSetup ({ cache: false });
$.get("config-stream.php?pegar=musica-atual", function(verifica){
var musicaAtual = $("#tudo").text();
if(verifica != musicaAtual){
$("#tudo").html(verifica);
}
});
}, 2000);
});
And the related HTML...
<div id="tudo">
valorinicial
</div>
<p id="oi"></p>
I don’t understand your problem? What’s not working?
– Sergio
When I use the condition structure does not return me results
– Victor Borges
what gives
console.log(musicaAtual, verifica);
before the line that has theif
?– Sergio
It wouldn’t be better to use stream Events ¿
– Edilson