I believe you want the function to show Number() to be called every 1.5 minutes. If so, there are two ways: 1) use the setInterval() function instead of setTimeout() in the example @Lucas-torres gave; 2) recall setTimeout() within the function displaNotificacao(), right after executing the main code.
But in both cases, I think it’s more appropriate to define the function show Rating() within $(Ocument). ready().
That is, by mode 1):
$(document).ready(function() {
mostrarNotificacao();
setInterval(mostrarNotificacao, 90000);
function mostrarNotificacao() {
var url = "../../componentes/php/ff_notificacao_php.php";
$('.modal-content').load(url, function(resultado) {
$('#conteudoNotificacao').html(resultado);
});
}
});
and mode 2):
$(document).ready(function() {
var timerId = 0;
mostrarNotificacao();
function mostrarNotificacao() {
clearTimeout(timerId);
var url = "../../componentes/php/ff_notificacao_php.php";
$('.modal-content').load(url, function(resultado) {
$('#conteudoNotificacao').html(resultado);
timerId = setTimeout(mostrarNotificacao, 90000);
});
}
});
The advantage of this second mode is that if the load() response takes longer than 1.5 minutes, one timeout will not overlap the other.
Voce wants it to appear at first, and then at intervals?
– Lucas Torres
That’s what I’m talking about
– Gabriel Filippi