跳转到主要内容

Window: cancelIdleCallback() method

{{APIRef}}

The window.cancelIdleCallback() method cancels a callback previously scheduled with {{domxref("window.requestIdleCallback()")}}.

Syntax

cancelIdleCallback(handle)

Parameters

  • handle
    • : The ID value returned by {{domxref("window.requestIdleCallback()")}} when the callback was established.

Return value

None ({{jsxref("undefined")}}).

Examples

See our complete example in the article Cooperative Scheduling of Background Tasks API.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}