Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Javascript (https://www.askmehelpdesk.com/forumdisplay.php?f=452)
-   -   How to close a window via anotherframe (https://www.askmehelpdesk.com/showthread.php?t=123910)

  • Aug 29, 2007, 04:57 AM
    gopitamil
    How to close a window via anotherframe
    Here I have two frames

    Frame1 with a link,frame 2 with logout
    Whenever I click a link in frame1 a new popup window will open.
    I have to close that window via frame2 logout option.
    Can anyone help?
  • Aug 29, 2007, 05:02 AM
    WadeG
    Quote:

    Originally Posted by gopitamil
    here i have two frames

    frame1 with a link,frame 2 with logout
    whenever i click a link in frame1 a new popup window will open.
    i have to close that window via frame2 logout option.
    can anyone help?

    I am assuming you are spoeaking of HTML?
    If so are you using a editor (ie. Front page)? Are you able to let us see the code?
  • Sep 4, 2007, 09:54 PM
    jstrike
    If you have a JavaScript function that opens a window in Frame 1, put a function on that same frame to close the window.
    For example:
    Code:

    var winHandle;
    function openWindow() {
      winHandle=open(.....);
    }

    function closeWindow() {
      winHandle.close();
    }

    In frame 2 when you want to close the popup refer to the function in frame 1 by using parent.
    Code:

    function logout() {
      ...do some stuff...
      parent.closeWindow();

    I'm doing this off the top of my head so you'll obviously have to mess around with it a bit, but that should give you an idea of the general concept.

    Good Luck.

  • All times are GMT -7. The time now is 07:50 PM.