在一天的特定时间开火 [英] Fire event at a certain time of the day

查看:47
本文介绍了在一天的特定时间开火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用javascript(jQuery解决方案也可以)在一天的特定时间触发事件/调用函数,例如

Is it possible with javascript (jQuery solutions are fine too) to fire an event/call a function at certain times of the day e.g.

在10处调用myFunctionA: 00

call myFunctionA at 10:00

在14:00拨打myFunctionB
等..

call myFunctionB at 14:00 etc..

谢谢

标记

推荐答案


  • 获取当前时间

  • 以毫秒为单位,下一个执行时间减去当前时间之间的时间差

  • 结果为millisecons的Settimeout

  • 这篇关于在一天的特定时间开火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆