window.cancelIdleCallback()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
window.cancelIdleCallback()
方法用于取消之前调用window.requestIdleCallback()
的回调。
语法
js
cancelIdleCallback(handle)
参数
handle
-
调用
window.requestIdleCallback()
时返回的 ID.
返回值
无(undefined
)。
示例
在文章 Cooperative Scheduling of Background Tasks API 中可以查看 完整示例 。
规范
Specification |
---|
requestIdleCallback() # the-cancelidlecallback-method |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
cancelIdleCallback |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.