WebAPI/AlarmAPI: Difference between revisions

Jump to navigation Jump to search
m
Line 78: Line 78:
   navigator.mozAlarms.remove(alarmId2);
   navigator.mozAlarms.remove(alarmId2);


* How to listen to the <code>"alarm"</code> message and handle it with a callback function when an alarm goes off?
* How to listen to the <code>"alarm"</code> message and handle it with a callback function when the alarm goes off?


   navigator.mozSetMessageHandler("alarm", function (message) { alert("alarm fired: " + JSON.stringify(message)); });
   navigator.mozSetMessageHandler("alarm", function (message) { alert("alarm fired: " + JSON.stringify(message)); });
Confirmed users
110

edits

Navigation menu