From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/globaleventhandlers/onclose/index.html | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 files/ja/web/api/globaleventhandlers/onclose/index.html (limited to 'files/ja/web/api/globaleventhandlers/onclose') diff --git a/files/ja/web/api/globaleventhandlers/onclose/index.html b/files/ja/web/api/globaleventhandlers/onclose/index.html new file mode 100644 index 0000000000..8c0429e233 --- /dev/null +++ b/files/ja/web/api/globaleventhandlers/onclose/index.html @@ -0,0 +1,68 @@ +--- +title: window.onclose +slug: Web/API/GlobalEventHandlers/onclose +tags: + - API + - Dialog + - Event Handler + - Experimental + - GlobalEventHandlers + - HTML DOM + - NeedsExample + - Property + - Reference +translation_of: Web/API/GlobalEventHandlers/onclose +--- +
{{ApiRef("HTML DOM")}} {{SeeCompatTable}}
+ +

onclose は {{domxref("GlobalEventHandlers")}} ミックスインのプロパティで、ダイアログ要素に送信された {{event("close")}} イベントを処理するための {{domxref("EventHandler", "イベントハンドラー")}} です。

+ +

close イベントは、ユーザーが <dialog> を閉じたときに発生します。

+ +
+

注: ウィンドウのクローズを処理するには、{{domxref("WindowEventHandlers.onbeforeunload", "onbeforeunload")}} または {{domxref("WindowEventHandlers.onunload", "onunload")}} を使用します。

+
+ +

構文

+ +
target.onclose = functionRef;
+
+ +

+ +

functionRef は、関数名または関数式です。この関数は、{{domxref("Event")}} オブジェクトを唯一の引数として受け取ります。

+ +

一度に1つのオブジェクトに割り当てることができる onclose ハンドラーは1つだけです。代わりに、より柔軟性のある {{domxref("EventTarget.addEventListener()")}} メソッドを使用することをお勧めします。

+ +

仕様

+ + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG','webappapis.html#handler-onclose','onclose')}}{{Spec2('HTML WHATWG')}}
+ +

ブラウザの互換性

+ +
+ + +

{{Compat("api.GlobalEventHandlers.onclose")}}

+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf