--- title: window.clearImmediate slug: Web/API/Window/clearImmediate translation_of: Web/API/Window/clearImmediate ---

{{ ApiRef() }}

概述

此方法用来清除 {{ domxref("window.setImmediate") }}.

注意: 注意: 该方法最近刚刚被微软提出, 可能不会被w3c批准成为标准, 目前只有最新版Internet Explorer实现了该方法.

语法

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") }}