javascript - js/jquery: scheduling events -
I want to schedule events, which will call my predefined callback
How to schedule in JSL Can / Jquery:
- Once Event?
- Recurring events (to call your function every minute, or five minutes)?
You want once for the event and for the repeat incident.
Both take two arguments: one function and the time specified in milliseconds.
var delay_millis = 1500; // will warn once, timeout word handle = window to set at least half a second time after time. Setimmeet (function () {warning ("time has passed!");}, Delay_millis); // will repeatedly warn er var repeatHandle = window.setInterval (function () (warning ("Do I still bother you?");}, Delay_millis); Bonus: If you call these functions around the values returned, you can cancel the callback if you need it.
Bonus: shutupShutUp = function) {Window.clearInterval (repeatHandle); }; shut up shut up(); // Now I can think of myself
Comments
Post a Comment