From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/notification/data/index.html | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ja/web/api/notification/data/index.html (limited to 'files/ja/web/api/notification/data') diff --git a/files/ja/web/api/notification/data/index.html b/files/ja/web/api/notification/data/index.html new file mode 100644 index 0000000000..c56e63a5ee --- /dev/null +++ b/files/ja/web/api/notification/data/index.html @@ -0,0 +1,71 @@ +--- +title: Notification.data +slug: Web/API/Notification/data +tags: + - API + - Notification + - Notifications + - Notifications API + - Property + - Reference + - data + - プロパティ + - 通知 +translation_of: Web/API/Notification/data +--- +

{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}

+ +

data は {{domxref("Notification")}} インターフェイスの読取専用プロパティで、 {{domxref("Notification.Notification","Notification()")}} コンストラクターの data オプションで指定された通知の構造化されたデータのクローンを返します。

+ +

通知のデータは、通知と関連付けたい任意のデータを使用することができます。

+ +

構文

+ +
var data = Notification.data;
+
+ +

+ +

構造化されたクローン。

+ +

+ +

次のスニペットは通知を発行します。単純な options オブジェクトを生成し、それから Notification() コンストラクターを使用して通知を発行します。

+ +
var options = {
+  body: 'Do you like my body?',
+  data: 'I like peas.'
+}
+
+var n = new Notification('Test notification',options);
+
+console.log(n.data) // should return 'I like peas.'
+ +

仕様書

+ + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Web Notifications','#dom-notification-data','data')}}{{Spec2('Web Notifications')}}Living standard
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Notification.data")}}

+ +

関連情報

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