Notification.body

这篇翻译不完整。请帮忙从英语翻译这篇文章

 Notification 的只读属性body返回了构造函数Notification实例化时,options所使用的body值。

Note: 此特性在 Web Worker 中可用。

语法

var body = Notification.body;

DOMString.

示例

在 Emogotchi demo (see source code)中, 我们在激活一个桌面通知时,调用了spawnNotification()函数—函数被传入了指定的参数 body、icon、title , 创建了一个必选对象传入Notification() 构造函数创建了一个实例.

function spawnNotification(theBody,theIcon,theTitle) {
  var options = {
      body: theBody,
      icon: theIcon
  }
  var n = new Notification(theTitle,options);
}

规范

Specification Status Comment
Notifications API
body
Living Standard Living standard

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 5 webkit (see notes)
22
(Yes) 4.0 moz (see notes)
22
未实现 25 6 (see notes)
Available in workers ? ? 41.0 (41.0) ? ? ?
Feature Android Android Webview Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ?

(Yes)

(Yes) 4.0 moz (see notes)
22
1.0.1 moz (see notes)
1.2
未实现 ? 未实现

(Yes)

Available in workers ? ? ? 41.0 (41.0) ? ? ? ? ?

Firefox OS 备忘

Chrome 备忘

Safari 备忘

相关链接

文档标签和贡献者

 此页面的贡献者: unliar
 最后编辑者: unliar,