Javascript examples for Browser Object Model:Window setInterval
Run a function every Friday at 16:00
<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>