Refreshing the offline page

55 Views Asked by At

I have this problem for a long time and I can't figure it out by my own.

I have a project that is coded in Django. The project has some data in the SQL tables and there are some tables which are empty yet and the empty tables will be filled by the real date and time matches with the date and time which comes from SQL table.

Some how i manage this if my site is open. in the code i have a little refresher function like this;

// The refresher function;
function myFunction() {
    var x = document.getElementById("myDIV");
    if (x.style.display === "none") {
      x.style.display = "block";
    } else {
      x.style.display = "none";
    }
  }
  window.setTimeout( function() {
  window.location.reload();
}, 60000);

It works fantastic if the site is open in the browser but I need it to work fine again if the website is not open in the browser.

Is there any way to manage that?

0

There are 0 best solutions below