Notification
的只读属性body返回了构造函数Notification
实例化时,options所使用的body值。
Note: 此特性在 Web Worker 中可用。
语法
var body = Notification.body;
值
示例
在 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!