【问题标题】:I need to redirect a page when time become 00.00 [closed]当时间变为 00.00 时,我需要重定向页面 [关闭]
【发布时间】:2017-01-02 00:02:22
【问题描述】:

我要祝我的朋友生日,所以我打算告诉我的朋友在 11.55 打开一个网页,当时间到 12.00 我需要自动将我朋友的页面重定向到我的问候页面并帮助我完成任务

【问题讨论】:

  • 你可以使用javascript在00:00显示一条消息。
  • ...或者您可以带他去脱衣舞娘或现实世界中的其他地方......?
  • 你有什么尝试吗?任何代码,任何尝试显示?
  • ...或者只是告诉在 12:00 打开您的问候页面?
  • 你还能访问“我朋友的页面”吗?

标签: javascript php html redirect


【解决方案1】:

通过使用javascript进入朋友的页面

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript">
    function greetings(){
      var now =new Date();
      if (now.getHours()===0 && now.getMinutes()===0) window.location.href='http://google.com';
    }
    setInterval(greetings,10000);
    </script>
  </head>
  <body>
  </body>
</html>

【讨论】:

  • 感谢 angelito,我会写这段代码
  • 辛苦了,谢谢亲爱的 angelito
猜你喜欢
  • 1970-01-01
  • 2014-04-23
  • 1970-01-01
  • 2014-06-01
  • 1970-01-01
  • 2011-06-03
  • 2011-05-27
  • 2016-08-10
  • 2018-02-09
相关资源
最近更新 更多