$.gritter.add({ title: "ENTRANDO A MORA", text: "Tienes <?php echo count($casimora); ?> cliente(s) que esta(n) por entrar a mora", image: "images/informacion.png", sticky: false }); return false; } ); <?php } $notificacion = new Notificacion(); $enmora = $notificacion->misclientes($_SESSION['usuarioactual'], 'enmora'); if (count($enmora) > 0) { //********************************SI TIENE CLIENTES EN MORA ?> $('add-gritter-light').ready(function(){//cambie click por ready para que se carge automaticamente $.gritter.add({ title: "CLIENTES EN MORA", text: "Tienes <?php echo count($enmora); ?> cliente(s) que esta(n) en mora", image: "images/alerta.png", sticky: false }); return false;