Every now and then I have needed to access the parent page enclosing an
IFrame and I have never really found a good
straight-forward example of how to do it, so I end up having to work it out each time I need it.
So, for a parent (enclosing page) with an
IFrame as follows:
where the "visitor.html" page called by the
IFrame is given as:
When the "Close Me" button is clicked, the parent page will dispose of the
function to do this actually resides in the parent page. One thing to note, is that both pages must reside on the same
domain (or sub-domain) or else the script will not work, due to security restrictions.