Error updating Div automatically

0

I have a chat and I need to update automatically by sending the automatic scroll down, the problem is that at the time of reloading the div is embedded in the whole web page on that div, I leave the code and error:

<div id="chat"></div>//DIV QUE DESEO RECARGAR
<script>
$(document).ready(function() {
      var refreshId =  setInterval( function(){
    $('#chat').load(perfil2-chat.php);//actualizo el div
   }, 1000 );
});
</script>
    
asked by Erik Shasha 23.05.2018 в 17:38
source

1 answer

1

The error is in what you call your php page in the .load() should be in double or single quotes from the next way.

$('#chat').load('perfil2-chat.php');//actualizo el div
   }, 1000 );
    
answered by 23.05.2018 в 17:47