タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

JavaScriptとスケジュールに関するiwwのブックマーク (1)

  • clearTimeout() - Web API | MDN

    ウェブページのコンテキストで以下のスクリプトを実行し、ページを一度クリックしてください。1秒後にメッセージがポップアップします。1秒間に複数回ページをクリックしても、アラートは一度しか表示されません。 const alarm = { remind(aMessage) { alert(aMessage); this.timeoutID = undefined; }, setup() { if (typeof this.timeoutID === "number") { this.cancel(); } this.timeoutID = setTimeout( (msg) => { this.remind(msg); }, 1000, "Wake up!", ); }, cancel() { clearTimeout(this.timeoutID); }, }; window.addEvent

    clearTimeout() - Web API | MDN
  • 1