dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help! Close in iframe in an iframe

  1. #1
    Join Date
    Jan 2010
    Posts
    1

    Question Help! Close in iframe in an iframe

    The Scenario: On my site I have a pop-up modal window (tinybox) with an iframe in it. I close this iframe successfully using:

    window.parent.document.getElementById('someid').parentNode.removeChild(window.parent.document.getEle mentById('someid'));

    where 'someid' is the id of the iframe that's in the modal window.

    The problem: My site is displayed in an iframe on other sites (with permission) So now there is an iframe in site A displaying my site B and site B then has a modal window with the iframe 'someid' that needs to be closed.

    I've tried lots of combinations of parent, window, contentWindow,
    top.window etc and can't find any that work.

    I can give the top iframe on site A, the new top domain, an id of my choosing if that helps. eg topframe and can add javascript to site A or site B.

    This is the structure as I think...

    parent (site A)--> document in parent --> iframe in document (topframe) --> 2nd parent (site B - my site)--> document in 2nd parent --> iframe in document (someid)

    I think the problems may be due to security issues where the 2 iframes are in different domains, but equally it could just be due to my poor understanding of parents, child nodes etc not leading me to the correct javascript command.

    I am a relative javascript newbie so any help from you wise old javascript sages out there greatly appreciated.

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Unfortunately for you, the cross-domain javascript relationship between documents is not possible for obvious security reasons

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles