<style> body { background-size: cover; background-position: center; background-attachment: fixed; /* background-image: url(<?php echo $url; ?>/img/bg_juegos.jpg); */ background-color: #939597; } </style> <span id="num"></span> <div id="vista"> </div> <script> var w = 0; var api = '<?php echo $api; ?>'; function RankingGeneral() { w = w + 1; $("#num").text(w); jQuery.ajax({ url: api + "ranking_trip.php", type: 'post', data: { id: 0 }, }).done(function(resp) { $("#vista").html(resp); }) .fail(function(resp) { console.log(resp); }) .always(function(resp) {}); } //RankingGeneral(); setInterval(RankingGeneral, 10000); </script>