Update Real-time DIV [duplicate]

-1

I would like to update only one div of a site, without updating the whole site and that this div was updated 0.1 seconds every 0.1 seconds, and that for example it was not necessary to refresh or re-enter the site.

I would basically like to make a change on my server, and not have to tar update the site to see this change, but I wanted it to happen in just 1 div of my site.

How can I do this?

Thank you.

    
asked by anonymous 14.02.2016 / 21:04

1 answer

-1
   <script>
   var nomedafuncao = function () {
  $('#iddadiv').load('paginaquequercarregar.php?_=' + new Date().getTime());
  };
   setInterval(nomedafuncao, 1000); // <- 1000 tempo em milisegundos = 1 segundo
   </script>

Another option is to use long pooling

    
14.02.2016 / 22:46