Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js alarm go to url

function goUrlAlarm(time = '01:02:03', url) {
  const today = new Date();
  const month = today.getUTCMonth();
  const day = today.getUTCDate();
  const year = today.getUTCFullYear();
  const x = new Date(`${year}-${month}-${day}T${time}`);
  const t = new Date(x) - new Date();
  setTimeout(function () {
    location.href = url;
  }, t);
}

goUrlAlarm('12:00:00', 'http://google.com');
 
PREVIOUS NEXT
Tagged: #js #alarm #url
ADD COMMENT
Topic
Name
2+6 =