aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/window/frames/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/web/api/window/frames/index.html')
-rw-r--r--files/ru/web/api/window/frames/index.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/files/ru/web/api/window/frames/index.html b/files/ru/web/api/window/frames/index.html
new file mode 100644
index 0000000000..271af17e78
--- /dev/null
+++ b/files/ru/web/api/window/frames/index.html
@@ -0,0 +1,57 @@
+---
+title: Window.frames
+slug: Web/API/Window/frames
+translation_of: Web/API/Window/frames
+---
+<p>{{APIRef("DOM")}}</p>
+
+<p>Возвращает само окно, являющееся объектом в виде массива, распечатывая элементы текущего окна.</p>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="eval"><em>frameList</em> = window.frames;
+</pre>
+
+<ul>
+ <li><code>frameList</code> is a list of frame objects. It is similar to an array in that it has a <code>length</code> property and its items can be accessed using the <code>[i]</code> notation.</li>
+ <li><code>frameList === window</code> evaluates to true.</li>
+ <li>Each item in the window.frames pseudo-array represents the <a class="internal" href="/en/DOM/window" title="en/DOM/window">window</a> object corresponding to the given <a class="internal" href="/en/HTML/Element/frame" title="en/HTML/Element/frame">&lt;frame&gt;</a>'s or <a class="internal" href="/en/HTML/Element/iframe" title="en/HTML/Element/iframe">&lt;iframe&gt;</a>'s content, not the (i)frame DOM element (i.e., <code>window.frames[0]</code> is the same thing as <code>document.getElementsByTagName("iframe")[0].contentWindow</code>).</li>
+ <li>For more details about the returned value, refer to this <a class="external" href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/5628c6f346859d4f/169aa7004565066?hl=en&amp;ie=UTF-8&amp;oe=utf-8&amp;q=window.frames&amp;pli=1" title="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/5628c6f346859d4f/169aa7004565066?hl=en&amp;ie=UTF-8&amp;oe=utf-8&amp;q=window.frames&amp;pli=1">thread on mozilla.dev.platform</a> [dead link].</li>
+</ul>
+
+<h2 id="Example" name="Example">Example</h2>
+
+<pre class="brush: js">var frames = window.frames; // or // var frames = window.parent.frames;
+for (var i = 0; i &lt; frames.length; i++) {
+ // do something with each subframe as frames[i]
+ frames[i].document.body.style.background = "red";
+}
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="spectable standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName("HTML WHATWG", "browsers.html#dom-frames", "Window.frames")}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName("HTML5 W3C", "browsers.html#dom-frames", "Window.frames")}}</td>
+ <td>{{Spec2("HTML5 W3C")}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.Window.frames")}}</p>