aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/html/global_attributes/itemid/index.html
blob: 79941cabc21477b4b59aa0ba4d11cdba4c97c9b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
title: itemid
slug: Web/HTML/Global_attributes/itemid
tags:
  - Attribute
  - Global attribute
  - HTML
  - Microdata
  - Reference
translation_of: Web/HTML/Global_attributes/itemid
---
<div>{{HTMLSidebar("Global_attributes")}}</div>

<p>L'<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes">atribut global</a> <strong>itemid</strong> és l'identificador únic i global d'un element.  Els atributs itemid només es poden especificar en els elements que tenen tant els atributs <strong>itemscope</strong> com <strong>itemtype</strong>. A més, el itemid només es pot especificar en elements amb un atribut itemscope de qui el corresponent itemtype es refereix o defineix un vocabulari que suporta identificadors globals.</p>

<p>El vocabulari dels <code>itemtype's</code> donarà el significat exacte d'un identificador global definit dins del vocabulari. El vocabulari definirà si diversos elements amb el mateix identificador global poden coexistir i, si se'ls permet, de com manejar els elements amb el mateix identificador.</p>

<p class="note"><strong>Nota:</strong> La definició de Whatwg.org d'un itemid diu que ha de ser una adreça URL. Això no sembla ser el cas, com mostra el següent exemple. Més aviat la definició de facto és que un itemid és un identificador únic, de manera que un URN és apropiat. Aquesta inconsistència reflecteix, sens dubte, el caràcter incomplet de l'especificació de Microdata.</p>

<h2 id="Exemple">Exemple</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;dl itemscope
    itemtype="http://vocab.example.net/book"
    itemid="urn:isbn:0-330-34032-8"&gt;
&lt;dt&gt;Title &lt;dd itemprop="title"&gt;The Reality Dysfunction
&lt;dt&gt;Author &lt;dd itemprop="author"&gt;Peter F. Hamilton
&lt;dt&gt;Publication date
&lt;dd&gt;&lt;time itemprop="pubdate" datetime="1996-01-26"&gt;26 January 1996&lt;/time&gt; &lt;/dl&gt;</pre>

<h3 id="Estructuració_de_les_dades"><span class="short_text" id="result_box" lang="ca"><span>Estructuració de les dades</span></span></h3>

<table class="standard-table">
 <tbody>
  <tr>
   <td colspan="1" rowspan="14">itemscope</td>
   <td>itemtype: itemid</td>
   <td colspan="2" rowspan="1">
    <div class="jyrRxf-eEDwDf jcd3Mb IZ65Hb-hUbt4d">http://vocab.example.net/book: urn:isbn:0-330-34032-8</div>
   </td>
  </tr>
  <tr>
   <td>itemprop</td>
   <td>title</td>
   <td>The Reality Dysfunction</td>
  </tr>
  <tr>
   <td>itemprop</td>
   <td>author</td>
   <td>
    <div class="jyrRxf-eEDwDf jcd3Mb">Peter F. Hamilton</div>
   </td>
  </tr>
  <tr>
   <td>itemprop</td>
   <td>pubdate</td>
   <td>1996-01-26</td>
  </tr>
 </tbody>
</table>

<h3 id="Resultat">Resultat</h3>

<p>{{EmbedLiveSample('HTML', '', '', '', 'Web/HTML/Global_attributes/itemid')}}</p>

<h2 id="Especificacions">Especificacions</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificació</th>
   <th scope="col">Estat</th>
   <th scope="col">Comentari</th>
  </tr>
  <tr>
   <td><code><a href="https://html.spec.whatwg.org/multipage/microdata.html#attr-itemid">itemid</a></code></td>
   <td> </td>
   <td>WG Nota - <span class="short_text" id="result_box" lang="ca"><span>Ja</span> <span>no s'està</span> <span>desenvolupant</span> <span>activament</span></span></td>
  </tr>
 </tbody>
</table>

<h2 id="Navegadors_compatibles">Navegadors compatibles</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Característica</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Suport bàsic</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Característica</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Suport bàsic</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="Veure">Veure</h2>

<ul>
 <li><a href="/en-US/docs/Web/HTML/Global_attributes">Altres atributs globals diferents</a></li>
 <li>Altres atributs globals relacionats amb microdata:
  <ul>
   <li>{{htmlattrxref("itemid")}}</li>
   <li>{{htmlattrxref("itemprop")}}</li>
   <li>{{htmlattrxref("itemref")}}</li>
   <li>{{htmlattrxref("itemscope")}}</li>
   <li>{{htmlattrxref("itemtype")}}</li>
  </ul>
 </li>
</ul>