From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- .../onrejectionhandled/index.html | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 files/uk/web/api/windoweventhandlers/onrejectionhandled/index.html (limited to 'files/uk/web/api/windoweventhandlers/onrejectionhandled') diff --git a/files/uk/web/api/windoweventhandlers/onrejectionhandled/index.html b/files/uk/web/api/windoweventhandlers/onrejectionhandled/index.html new file mode 100644 index 0000000000..81cabc79bd --- /dev/null +++ b/files/uk/web/api/windoweventhandlers/onrejectionhandled/index.html @@ -0,0 +1,52 @@ +--- +title: WindowEventHandlers.onrejectionhandled +slug: Web/API/WindowEventHandlers/onrejectionhandled +tags: + - API + - HTML DOM + - JavaScript + - Promise + - WindowEventHandlers + - onrejectionhandled + - Обробник подій + - Проміс + - події +translation_of: Web/API/WindowEventHandlers/onrejectionhandled +--- +
{{APIRef}}
+ +

Властивість onrejectionhandled домішки {{domxref("WindowEventHandlers")}} - це {{domxref("EventHandler")}} для обробки подій rejectionhandled. Ці події виникають, коли відхиляються об'єкти {{jsxref("Promise")}}.

+ +

Синтаксис

+ +
window.addEventListener("rejectionhandled", function(event) { ... });
+window.onrejectionhandled = function(event) { ...};
+ +

Приклад

+ +
window.onrejectionhandled = function(e) {
+  console.log(e.reason);
+}
+ +

Специфікації

+ + + + + + + + + + + + + + +
СпецифікаціяСтатусКоментар
{{SpecName('HTML WHATWG', 'webappapis.html#handler-window-onrejectionhandled', 'onrejectionhandled')}}{{Spec2('HTML WHATWG')}}Початкове визначення.
+ +

Сумісність з веб-переглядачами

+ + + +

{{Compat("api.WindowEventHandlers.onrejectionhandled")}}

-- cgit v1.2.3-54-g00ecf