The Window.frames property is a collection of all frames for the current page. Note that there is no frame and IFRAME to make a distinction. Also, the Window.frames property always exists, regardless of the frame in which the page exists, and always points to the Window object itself.
// true;
Suppose we have an IFRAME element in our page:
<name= "MyFrame" src= "hello.html"/>
We can see if the frame element exists in the page by checking its Length property.
Frames.length; 1
If you want to access the window object of an IFRAME element, you can choose either of the following methods:
Window.frames[0];window.frames[0].window;window frames[0].window.frames;frames[0 ].window;frames[0];
From the parent page, we can access the properties of the child frame element. For example, you can have an overload of the IFRAME element in the following way.
Frames[0].window.location.reload ();
In the same way, we can access the parent page through child elements.
frames[0].parent = = = Window
We can access the topmost page through a property called the top:
// true // true // true;
In addition, there is a self property, which is essentially the same as window.
Self = = = window; True
Frames[0].self = = Frames[0].window; True
If the frame element has the name attribute, we can drop the index and then access the frame by the value of the Name property;
window.frames[' myframe '] = = = Window.frames[0]; // true
Or it can also:
// true
Window.frames of JavaScript host objects