Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

auto reload page in chat php

$(document).ready(function() {
  // check once in five seconds
  setInterval(function() {
    $.get('/script.php', {do: 'new_messages'}, function(response) {
      if(response == 1) {
        window.location.reload();
      }
    });
  }, 5000); 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #auto #reload #page #chat #php
ADD COMMENT
Topic
Name
1+8 =