www.webdeveloper.com
Results 1 to 5 of 5

Thread: Issue with third party application window close functionality

  1. #1
    Join Date
    Sep 2011
    Posts
    3

    Issue with third party application window close functionality

    Hi All,

    I have a requirement as below.

    On load of a HTML page, the system should open new browser window which has a IFrame inside it.

    This IFrame will display a thiry party web application content(it is a secured application with username/password) in it with a OK button. We don't have any control on this third party application.

    When we click on OK button, the system should close the new browser window,which we have opened just before.

    The problem is the new browser window is not getting closed.


    My observations
    1.If I try to load the third party web application directly into the new browser window(without any IFrame), the new browser window is getting closed when we click on 'OK' button.
    2. I am thinking that this third party application people are calling just window.close() to close the browser window.But in case of IFrame, it is not working.I did a small POC on this like this. I have a main.html which has a IFrame where first.html gets displayed.I kept a button(OK button) in first.html and it is getting displayed in IFrame.I have written some javascript code like window.close() which gets called when we click on Ok button.In this case, the window is not getting closed. But If I change the javascript code to top.window.close(), the whole browser window getting closed.

    Please help me on this.

    Please provide if you have any workaround for this.

    Thanks in advance

    Regards,
    Ravi Boreddy

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by rboreddy View Post
    [...]
    This IFrame will display a thiry party web application content(it is a secured application.We don't have any control on this third party application.
    [...]
    When we click on OK button, the system should close the new browser window,which we have opened just before.
    [...]
    Please provide if you have any workaround for this.
    There is no workaround. Should have been if you could have written a JavaScript code within that third part document. And even so, some browsers will not permit the closing of a parent commanded from a document loaded in an iframe. As a general rule, there are no possible direct and biunivocal JavaScript relationship between documents which belong to different domains, for obvious security reasons. After all, JavaScript is a client-side language.
    Last edited by Kor; 09-21-2011 at 09:06 AM.

  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Hi Kor,

    Thanks for your reply.
    <BR>
    Let me explain my project requirement.
    <BR>
    On load of a HTML page, the system should open new browser window where it should display third party application primary URL content.
    <BR>
    And also, we will display one alternative URL on the top as a link.
    and we provide a message saying that If we see any error with primary URL content, then click on alternative URL.As and when click on this alternative URL, the current browser window should display alternative URL content.
    <BR>
    Note:At present I am using Iframe SRC attribute to deal with primary URL and alternative URL

    <BR>Please suggest if you have any other solution to acheive my requirement.

    <BR>Thanks in advance.
    <BR>
    Regards,
    Ravi Boreddy

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    So, let me see if I well understood.

    On load of a document on your domain, let's say document A, another window/tab should be opened, say document B, which belongs also to your domain. That document B has: 1. an iframe which should load a third part document (let's say document TP1) and 2. a link, which will drive to another third part document, say TP2.

    Now, if the TP1 is not visible in the iframe, the user is invited to press that link, which should close the pop-up (the document B) and redirect the parent (document A) to the TP2 address.

    Is this what you want?

  5. #5
    Join Date
    Sep 2011
    Posts
    3

    Explanation regarding the problem

    Hi Kor,

    Please see the attached screen shot for more details.

    From the parent window, I will open a new window and will load primary third party URL into the IFrame of new window.

    If I seee any error with primary third party URL in the IFrame, I will just click on alternative URL , which reloads the IFrame with the altenative URL.

    Note: Here I am not closing any window.

    Please suggest if you any other alternative solution to acheive this.

    Thanks & Regards,
    Ravi Boreddy
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

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