How to refresh the html page every 2 minutes?

I am currently using a html page to view in my iOS and Android apps. I don't want to update my own code and was wondering if I can just update the home page, which is index.html every 2 minutes? Is it possible?

+3


source to share


4 answers


You can use:



<META HTTP-EQUIV="refresh" CONTENT="120">

      

+4


source


You can try using like this:

<meta http-equiv="refresh" content="120">

      



or you can use setInterval

like this:

setInterval(function() {
    window.location.reload();
}, 120000); 

      

+5


source


use this

  setTimeout(function(){
       window.location.reload(1);
    }, 120000);

      

EDIT Put this in your head

<script>
      setTimeout(function(){
           window.location.reload(1);
        }, 120000);
</script>

      

EDIT

to attach this function only when the page is ready use

<script>
     $('document').ready(function(){
        setTimeout(function(){
           window.location.reload(1);
        }, 120000);
     });
</script>

      

+3


source


You can put a meta tag before starting html eg.

<meta http-equiv="refresh" content="120">
  <html> 
    <head>
      <meta charset="UTF-8">    
        <title>Mart</title>

      

0


source







All Articles