Властивість onrejectionhandled
домішки WindowEventHandlers
- це EventHandler
для обробки подій rejectionhandled. Ці події виникають, коли відхиляються об'єкти Promise
.
Синтаксис
window.addEventListener("rejectionhandled", function(event) { ... }); window.onrejectionhandled = function(event) { ...};
Приклад
window.onrejectionhandled = function(e) {
console.log(e.reason);
}
Специфікації
Специфікація | Статус | Коментар |
---|---|---|
HTML Living Standard The definition of 'onrejectionhandled' in that specification. |
Living Standard | Початкове визначення. |
Сумісність з веб-переглядачами
BCD tables only load in the browser
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.