html - Javascript window object -



html - Javascript window object -

in javascript, let's have main page (main.html) contains <iframe> (iframe.html)

now within iframe.html, if need refer on main page (main.html) , can not specify window instead of parent.window

if reply need write parent.window, wanted understand there not single window object reference iframes within main page..

while understand document specific individual iframes, window should mutual all..isn't it...please help me in understanding concept...

also there window.parent ? if yes, how differ parent.window ?

the concept of window tied document: there's 1 window per document, , 1 document per window.

that means <iframe> elements, have own document, have own window, pop-up window or main navigator window.

so, you'll indeed have utilize window.parent access container of <iframe> element, have utilize window.opener access owner of pop-up window.

edit: both window.parent , parent.window valid expressions homecoming same object. that's because window object default context in scripting (unqualified names parsed members of window), , window objects have window property refers themselves.

so, parent.window evaluated window.parent.window, same object window.parent.

that said, prefer using window.parent, avoid (minimal) overhead associated property access.

javascript html dom iframe window

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -