-
Edit:
The Since the macro is duplicating the content, do you think we could add the table to one page like this: DOM methods dealing with element's attributes:
<table class="standard-table">
<thead>
<tr>
<th>Not namespace-aware, most commonly used methods</th>
<th>Namespace-aware variants (DOM Level 2)</th>
<th>
DOM Level 1 methods for dealing with <code>Attr</code> nodes directly
(seldom used)
</th>
<th>
DOM Level 2 namespace-aware methods for dealing with
<code>Attr</code> nodes directly (seldom used)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{domxref("element.setAttribute","setAttribute")}} (DOM 1)</td>
<td>{{domxref("element.setAttributeNS","setAttributeNS")}}</td>
<td>{{domxref("element.setAttributeNode","setAttributeNode")}}</td>
<td>{{domxref("element.setAttributeNodeNS","setAttributeNodeNS")}}</td>
</tr>
<tr>
<td>{{domxref("element.getAttribute","getAttribute")}} (DOM 1)</td>
<td>{{domxref("element.getAttributeNS","getAttributeNS")}}</td>
<td>{{domxref("element.getAttributeNode","getAttributeNode")}}</td>
<td>{{domxref("element.getAttributeNodeNS","getAttributeNodeNS")}}</td>
</tr>
<tr>
<td>{{domxref("element.hasAttribute","hasAttribute")}} (DOM 2)</td>
<td>{{domxref("element.hasAttributeNS","hasAttributeNS")}}</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>{{domxref("element.removeAttribute","removeAttribute")}} (DOM 1)</td>
<td>{{domxref("element.removeAttributeNS","removeAttributeNS")}}</td>
<td>{{domxref("element.removeAttributeNode","removeAttributeNode")}}</td>
<td>-</td>
</tr>
</tbody>
</table> And refer to it like:
The source is here: https://github.com/mdn/yari/blob/main/kumascript/macros/DOMAttributeMethods.ejs including translations. The rationale is that we can get rid of the macro and move the translation out of Yari and into a single place in content / translated content instead. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes. I think we could:
The guide pages under https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model are really old and could do with a deeper refresh, but the above are simpler options. |
Beta Was this translation helpful? Give feedback.
Yes. I think we could:
either have a short guide page under https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model called "Getting and setting attributes" or something, that talks briefly about these methods, and link there from these pages instead of dropping this table in. I don't think a tabular format is particularly useful here and doubt anyone cares what is DOM level 1 or 2 at this point.
or (my preference I think) we could just throw this table away, and in the pages for
*AttributeNS()
and*Attribute()
, have a note pointing to the corresponding*Attribute()
page, saying that these are much more often used, something like: