diff options
author | MDN <actions@users.noreply.github.com> | 2021-04-16 00:10:51 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-04-16 00:10:51 +0000 |
commit | 9daad59fa2578dcc9603833b0a9a22b93d362b5e (patch) | |
tree | cf66aa37e5a7f19aff75a5e8d2b2773f0b295048 /files/ru/web | |
parent | 91bea6bd04ae368a889436799187eeebb11d33a1 (diff) | |
download | translated-content-9daad59fa2578dcc9603833b0a9a22b93d362b5e.tar.gz translated-content-9daad59fa2578dcc9603833b0a9a22b93d362b5e.tar.bz2 translated-content-9daad59fa2578dcc9603833b0a9a22b93d362b5e.zip |
[CRON] sync translated content
Diffstat (limited to 'files/ru/web')
-rw-r--r-- | files/ru/web/api/parentnode/firstelementchild/index.html | 149 | ||||
-rw-r--r-- | files/ru/web/api/parentnode/lastelementchild/index.html | 161 |
2 files changed, 0 insertions, 310 deletions
diff --git a/files/ru/web/api/parentnode/firstelementchild/index.html b/files/ru/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 9a7275fcc4..0000000000 --- a/files/ru/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: Web/API/ParentNode/firstElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/firstElementChild ---- -<p>{{ APIRef("DOM") }}</p> - -<p>Доступное только для чтения свойство <strong><code>ParentNode.firstElementChild</code></strong> возвращает первый дочерний элемент объекта ({{domxref("Element")}}) или <code>null</code> если дочерних элементов нет.</p> - -<div class="note"> -<p>This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, <code>firstElementChild</code> moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.</p> -</div> - -<h2 id="Syntax_and_values" name="Syntax_and_values">Синтаксис</h2> - -<pre class="syntaxbox">var <em>childNode</em> = elementNodeReference.firstElementChild; -</pre> - -<h2 id="Example" name="Example">Пример</h2> - -<pre class="brush: html"><p id="para-01"> - <span>First span</span> -</p> - -<script type="text/javascript"> - var p01 = document.getElementById('para-01'); - alert(p01.firstElementChild.nodeName) -</script></pre> - -<p>В этом примере alert показывает 'span', что является именем тега первого дочернего узла элемента p.</p> - -<h2 id="Polyfill_для_Internet_Explorer_8">Polyfill для Internet Explorer 8</h2> - -<p>Это свойство не поддерживается браузером Internet Explorer вплоть до 9 версии, поэтому следующий сниппет может быть использован для добавления поддержки IE8:</p> - -<pre class="brush: js">// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js -if(!("firstElementChild" in document.documentElement)){ - Object.defineProperty(Element.prototype, "firstElementChild", { - get: function(){ - for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i) - if(n = nodes[i], 1 === n.nodeType) return n; - return null; - } - }); -}</pre> - -<h2 id="Спецификация">Спецификация</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Спецификация</th> - <th scope="col">Статус</th> - <th scope="col">Комментарий</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Splitted the <code>ElementTraversal</code> interface in {{domxref("ChildNode")}} and <code>ParentNode</code>. This method is now defined on the latter.<br> - The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.</td> - </tr> - <tr> - <td>{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}</td> - <td>{{Spec2('Element Traversal')}}</td> - <td>Added its initial definition to the <code>ElementTraversal</code> pure interface and use it on {{domxref("Element")}}.</td> - </tr> - </tbody> -</table> - -<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Базовая поддержка ({{domxref("Element")}})</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Базовая поддержка ({{domxref("Element")}})</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Смотрите_также">Смотрите также</h2> - -<ul> - <li>{{domxref("ParentNode")}} и {{domxref("ChildNode")}}.</li> - <li> - <div class="syntaxbox">Типы объектов, имплементирующие данное свойство: {{domxref("Document")}}, {{domxref("Element")}}, и {{domxref("DocumentFragment")}}.</div> - </li> -</ul> diff --git a/files/ru/web/api/parentnode/lastelementchild/index.html b/files/ru/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index d625dc316f..0000000000 --- a/files/ru/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: Web/API/ParentNode/lastElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/lastElementChild ---- -<p>{{ APIRef("DOM") }}</p> - -<p><code><strong>Свойство ParentNode.lastElementChild</strong></code> только для чтения. Возвращает последний дочерний элемент объекта или <code>null</code> если нет дочерних элементов.</p> - -<div class="note"> -<p>This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, <code>lastElementChild</code> moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.</p> -</div> - -<h2 id="Syntax_and_values" name="Syntax_and_values">Синтаксис</h2> - -<pre class="syntaxbox">var <em>element</em> = node.lastElementChild; </pre> - -<h2 id="Example" name="Example">Пример</h2> - -<pre class="brush: html"><ul id="foo"> - <li>First (1)</li> - <li>Second (2)</li> - <li>Third (3)</li> -</ul> - -<script> -var foo = document.getElementById('foo'); -// yields: Third (3) -console.log(foo.lastElementChild.textContent); -</script> -</pre> - -<h2 id="Polyfill_for_IE8_IE9_and_Safari">Polyfill for IE8, IE9 and Safari</h2> - -<pre class="brush: js">// Overwrites native 'lastElementChild' prototype. -// Adds Document & DocumentFragment support for IE9 & Safari. -// Returns array instead of HTMLCollection. -;(function(constructor) { - if (constructor && - constructor.prototype && - constructor.prototype.lastElementChild == null) { - Object.defineProperty(constructor.prototype, 'lastElementChild', { - get: function() { - var node, nodes = this.childNodes, i = nodes.length - 1; - while (node = nodes[i--]) { - if (node.nodeType === 1) { - return node; - } - } - return null; - } - }); - } -})(window.Node || window.Element); -</pre> - -<h2 id="Спецификация">Спецификация</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td>Splitted the <code>ElementTraversal</code> interface in {{domxref("ChildNode")}} and <code>ParentNode</code>. This method is now defined on the latter.<br> - The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.</td> - </tr> - <tr> - <td>{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}</td> - <td>{{Spec2('Element Traversal')}}</td> - <td>Added its initial definition to the <code>ElementTraversal</code> pure interface and use it on {{domxref("Element")}}.</td> - </tr> - </tbody> -</table> - -<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2> - -<p>{{ CompatibilityTable() }}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>1.0</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9.0</td> - <td>10.0</td> - <td>4.0</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>29.0</td> - <td>{{CompatGeckoDesktop("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support (on {{domxref("Element")}})</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{CompatGeckoMobile("1.9.1")}}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - </tr> - <tr> - <td>Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("25.0")}}</td> - <td>{{CompatNo}}</td> - <td>16.0</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - - - -<h2 id="Так_же_смотрите">Так же смотрите</h2> - -<ul> - <li>The {{domxref("ParentNode")}} and {{domxref("ChildNode")}} pure interfaces.</li> - <li> - <div class="syntaxbox">Object types implementing this pure interface: {{domxref("Document")}}, {{domxref("Element")}}, and {{domxref("DocumentFragment")}}.</div> - </li> -</ul> |