NDEFRecord

草案
此页面不完整。

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers .

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

NDEFRecord interface of the Web NFC API is an abstract interface that represents data that can be read from or written to compatible NFC devices, e.g. NFC tags supporting NDEF.

构造函数

NDEFRecord()
返回新 NDEFRecord with configuration specified in the parameters or default ones if no parameters are specified.

属性

NDEFRecord.recordType 只读
Represents the NDEF record type.
NDEFRecord.mediaType 只读
Represents the MIME type of the NDEF record payload.
NDEFRecord.id 只读
Represents the identificator of the record.
注意: the uniqueness of the identifier is enforced only by the generator of the record.
NDEFRecord.data 只读
Represents the payload of the record.
NDEFRecord.encoding 只读
Represents the encoding name used for encoding the payload in the case it is textual data.
NDEFRecord.lang 只读
Represents a language tag of the content, if it was encoded.

方法

NDEFRecord.toRecords()
Coverts NDEFRecord.data to sequence of records.

规范

规范 状态 Comment
Web NFC, NDEFRecord 草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
NDEFRecord
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
NDEFRecord() 构造函数
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
data
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
encoding
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
id
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
lang
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
mediaType
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
recordType
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
Secure context required Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
toRecords
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No

图例

不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
  1. NDEFRecord