|
7 | 7 | - Web NFC
|
8 | 8 | browser-compat: api.NDEFRecord
|
9 | 9 | ---
|
10 |
| -<p>{{Draft}}{{securecontext_header}}{{SeeCompatTable}}{{APIRef()}}</p> |
| 10 | +<p>{{securecontext_header}}{{SeeCompatTable}}{{APIRef()}}</p> |
11 | 11 |
|
12 |
| -<p class="summary"><span class="seoSummary">The <strong><code>NDEFRecord</code></strong> interface of the <a href="/en-US/docs/Web/API/Web_NFC_API">Web NFC API</a> is an abstract interface that represents data that can be read from or written to compatible NFC devices, e.g. NFC tags supporting NDEF.</span></p> |
| 12 | +<p class="summary">The <strong><code>NDEFRecord</code></strong> interface of the <a href="/en-US/docs/Web/API/Web_NFC_API">Web NFC API</a> provides data that can be read from, or written to, compatible NFC devices, e.g. NFC tags supporting NDEF.</p> |
13 | 13 |
|
14 | 14 | <h2 id="Constructor">Constructor</h2>
|
15 | 15 |
|
16 | 16 | <dl>
|
17 | 17 | <dt>{{DOMxRef("NDEFRecord.NDEFRecord", "NDEFRecord()")}} {{Experimental_Inline}}</dt>
|
18 |
| - <dd>Returns a new <code>NDEFRecord</code> with configuration specified in the parameters or default ones if no parameters are specified.</dd> |
| 18 | + <dd>Returns a new <code>NDEFRecord</code>.</dd> |
19 | 19 | </dl>
|
20 | 20 |
|
21 |
| -<h2 id="Attributes">Attributes</h2> |
| 21 | +<h2 id="Properties">Properties</h2> |
22 | 22 |
|
23 | 23 | <dl>
|
24 | 24 | <dt>{{DOMxRef("NDEFRecord.recordType")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
25 |
| - <dd>Represents the NDEF record type.</dd> |
| 25 | + <dd>Returns the record type of the record. Records must have either a standardized well-known type name such as <code>"empty"</code>, <code>"text"</code>, <code>"url"</code>, <code>"smart-poster"</code>, <code>"absolute-url"</code>, <code>"mime"</code>, or <code>"unknown"</code> or else an external type name, which consists of a domain name and custom type name separated by a colon (":").</dd> |
| 26 | + |
26 | 27 | <dt>{{DOMxRef("NDEFRecord.mediaType")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
27 |
| - <dd>Represents the {{Glossary("MIME type")}} of the NDEF record payload.</dd> |
| 28 | + <dd>Returns the {{Glossary("MIME type")}} of the record. This value will be <code>null</code> if <code>recordType</code> is not equal to <code>"mime"</code>.</dd> |
| 29 | + |
28 | 30 | <dt>{{DOMxRef("NDEFRecord.id")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
29 |
| - <dd>Represents the identificator of the record.<br> |
30 |
| - <strong>Note:</strong> the uniqueness of the identifier is enforced only by the generator of the record.</dd> |
| 31 | + <dd>Returns the record identifier, which is an absolute or relative URL used to identify the record.<br> |
| 32 | + <strong>Note:</strong> The uniqueness of the identifier is enforced only by the generator of the record.</dd> |
| 33 | + |
31 | 34 | <dt>{{DOMxRef("NDEFRecord.data")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
32 |
| - <dd>Represents the payload of the record.</dd> |
| 35 | + <dd>Returns a {{jsxref("DataView")}} containing the raw bytes of the record's payload.</dd> |
| 36 | + |
33 | 37 | <dt>{{DOMxRef("NDEFRecord.encoding")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
34 |
| - <dd>Represents the encoding name used for encoding the payload in the case it is textual data.</dd> |
| 38 | + <dd>Returns the encoding of a textual payload, or <code>null</code> otherwise.</dd> |
| 39 | + |
35 | 40 | <dt>{{DOMxRef("NDEFRecord.lang")}} {{Experimental_Inline}} {{ReadOnlyInline}}</dt>
|
36 |
| - <dd>Represents a language tag of the content, if it was encoded.</dd> |
| 41 | + <dd>Returns the language of a textual payload, or <code>null</code> if one was not supplied.</dd> |
37 | 42 | </dl>
|
38 | 43 |
|
39 | 44 | <h2 id="Methods">Methods</h2>
|
40 | 45 |
|
41 | 46 | <dl>
|
42 | 47 | <dt>{{DOMxRef("NDEFRecord.toRecords", "NDEFRecord.toRecords()")}} {{Experimental_Inline}}</dt>
|
43 |
| - <dd>Coverts {{DOMxRef("NDEFRecord.data")}} to sequence of records.</dd> |
| 48 | + <dd>Converts {{DOMxRef("NDEFRecord.data")}} to a sequence of records. This allows parsing the payloads of record types which may contain nested records, such as smart poster and external type records.</dd> |
44 | 49 | </dl>
|
45 | 50 |
|
46 | 51 | <h2 id="Specifications">Specifications</h2>
|
|
0 commit comments