You were correct to some extent. window.opener
is a reference to the window, which opened current one. But this is applied only for windows called with window.open
function. And they're usually appear in new window (or tab).
If one needs to address different frames, then he should use parent
property for direct ancestor, top
for the topmost frame and frames
property for direct children. There're additional complications, when you use frameset
instead of iframe
s (like window with frameset don't have direct content). I hope you won't need them.