安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
lang
只读特性在
Notification
interface indicates the language used in the notification, as specified in the
lang
option of the
Notification()
构造函数。
The language itself is specified using a
DOMString
representing a
BCP 47 language tag
. See the Sitepoint
ISO 2 letter language codes
page for a simple reference.
var language = Notification.lang;
A
DOMString
specifying the language tag.
The following snippet fires a notification; a simple
选项
object is created, then the notification is fired using the
Notification()
构造函数。
var options = {
body: 'Do you like my body?',
lang: 'en-US'
}
var n = new Notification('Test notification',options);
console.log(n.lang) // should return 'en-US'
| 规范 | 状态 | 注释 |
|---|---|---|
|
Notifications API
The definition of 'lang' in that specification. |
实时标准 | Living standard |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
lang
|
Chrome Yes | Edge 14 | Firefox Yes | IE No | Opera Yes | Safari Yes | WebView Android No | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS No | Samsung Internet Android Yes |
完整支持
不支持
Notification