-
-
Save aleckyann/c28aac70be79fdadf8511d994b891ef5 to your computer and use it in GitHub Desktop.
BENK POOLING POOL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
/** | |
* Pooling pool para verificar se existem NOTIFICACAO NO DB != 0 | |
* Se houver mostra alerta | |
*/ | |
function refreshChatWhatsappAlert() { | |
$.ajax({ | |
method: "POST", | |
url: "URL-ONDE-PEGA-STATUS", | |
data: { | |
"NOTIFICACAO_ID": '1' | |
} | |
}).done(function(notificacoes) { | |
notificacoes = JSON.parse(notificacoes); | |
if (notificacoes > 0) { | |
//SE HOUVER MAIS DE UMA ATUALIZAÇÃO | |
} else { | |
SE NÃO HOUVR NENHUMA | |
} | |
setTimeout(refreshChatWhatsappAlert, 10000); //10 SEGUNDOS ENTRE CONSULTAS | |
}); | |
} | |
setTimeout(refreshChatWhatsappAlert, 3000); //3 SEGUNDOS PARA PRIMEIRA CONSULTA | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment