--- title: window.clearImmediate slug: Web/API/Window/clearImmediate translation_of: Web/API/Window/clearImmediate ---
{{ ApiRef() }}
此方法用来清除 {{ domxref("window.setImmediate") }}.
window.clearImmediate(immediateID)
这里的immediateID是由{{ domxref("window.setImmediate") }}返回的.
var immediateID = setImmediate(function () { // Run some code } document.getElementById("button").addEventListener(function () { clearImmediate(immediateID); }, false);
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatVersionUnknown() }} | {{ CompatNo() }} | {{ CompatNo() }} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatNo() }} |
{{ domxref("window.setImmediate") }}
{{ spec("https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html", "Specification: Efficient Script Yielding") }}