Results 1 to 4 of 4

Thread: Cross Domain Modal Window Close Question

  1. #1
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cross Domain Modal Window Close Question

    1) Script Title: Window Widget

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

    3) Describe problem:

    Ok, this is convoluted so bear with me. The script is located on my server. The page that is opened in the iFrame is on my server. But the page that is calling the script is in a different domain. So a 3rd party is executing the script from my domain and it opens a page in my domain in the iFrame but the executing page is in a different domain...

    I know there are cross-domain security issues but is there truly no way to close the iFrame from within the iFrame in this instance? When I use parent.ANYTHING it returns "Unsafe JavaScript attempt to access frame with URL"...

    HELP!

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Since you control both source domains, you might look at cross-domain messaging. not many browsers support it yet, however.

    since the containing page opens the iframe, why can't it be responsible for closing it?

  3. #3
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The user must click "Yes, I'd like to take a survey" within the iFrame and that is supposed to open a separate popup and close the dHTML window. But I don't control the domain that pops the actual window, only the content in the iFrame and the script file itself.

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    So.... is this correct?

    Page = not yours
    iFrame page = yours (though the iFrame itself is not yours)
    dhtml script = yours
    ---Question 1: how does the Page get your dhtml script? do they simply link to it (i.e., <script src="www.yoursite.com/dhtmlwindow.js">)?

    1) the Page opens your dhtml window.
    2) if the user clicks "yes," your dhtml window opens a popup with an iFrame, showing the iFrame page.
    ---Question 2: what is this "popup"? is it another dhtml window or similar modal window? is it a new browser window?
    3) you want the original dhtml window to close at this point.

    ...correct?
    Please post a link to the page on your site that contains the problematic script so we can check it out.

Bookmarks

Posting Permissions

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