From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/pushmessagedata/json/index.html | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 files/zh-cn/web/api/pushmessagedata/json/index.html (limited to 'files/zh-cn/web/api/pushmessagedata/json') diff --git a/files/zh-cn/web/api/pushmessagedata/json/index.html b/files/zh-cn/web/api/pushmessagedata/json/index.html new file mode 100644 index 0000000000..115fce8052 --- /dev/null +++ b/files/zh-cn/web/api/pushmessagedata/json/index.html @@ -0,0 +1,114 @@ +--- +title: PushMessageData.json() +slug: Web/API/PushMessageData/json +tags: + - PushMessageData.json() +translation_of: Web/API/PushMessageData/json +--- +

{{APIRef("Push API")}}{{SeeCompatTable()}}

+ +

{{domxref("PushMessageData")}} 接口的 json()方法将推送消息数据提取为 一个 JSON 对象。

+ +

Syntax

+ +
let massage_Json = PushEvent.data.json();
+ +

Parameters

+ +

None.

+ +

Returns

+ +

A JSON object.

+ +

Examples

+ +
self.addEventListener('push', function(event) {
+  var jsonObj = event.data.json();
+
+  // do something with your JSON
+});
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Push API', '#widl-PushMessageData-json-JSON', 'json()')}}{{Spec2('Push API')}}Initial definition.
+ +

Browser Compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(50.0)}}{{CompatGeckoDesktop(44.0)}}[1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatNo}}{{CompatGeckoMobile(48)}}[2]{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatChrome(50.0)}}
+
+ + + +

See also

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