Performance.onresourcetimingbufferfull
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
onresourcetimingbufferfull
属性是一个在 resourcetimingbufferfull
事件触发时会被调用的 event handler
。这个事件当浏览器的资源时间性能缓冲区已满时会触发。
语法
callback = performance.onresourcetimingbufferfull = buffer_full_cb;
返回值
- callback
-
一个当
resourcetimingbufferfull
事件触发时调用的事件处理器。
例子
下面的示例在 onresourcetimingbufferfull
属性上设置一个回调函数。
js
function buffer_full(event) {
console.log("WARNING: Resource Timing Buffer is FULL!");
performance.setResourceTimingBufferSize(200);
}
function init() {
// Set a callback if the resource buffer becomes filled
performance.onresourcetimingbufferfull = buffer_full;
}
<body onload="init()">
规范
Specification |
---|
Resource Timing # dom-performance-onresourcetimingbufferfull |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resourcetimingbufferfull event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Requires a vendor prefix or different name for use.
- Has more compatibility info.
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.