Run a function every Friday at 16:00 - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window setInterval

Description

Run a function every Friday at 16:00

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
window.onload = function() {/*from w w  w  .ja v a2  s  . com*/
  setInterval(function() {
    var date = new Date();
    if (date.getDay()==5 && date.getHours()==16 && date.getMinutes()==0 && date.getSeconds()==0) {
      console.log("4 O'CLOCK!");
    }
  },1000);
};

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials