Results 1 to 3 of 3

Thread: how to check a window is open in another jsp

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to check a window is open in another jsp

    Hi everyone,

    i have a question which im trying to solve

    in jsp1,"onClick" of link im opening in a new window
    href="#" onclick="JavaScript:popupOpen('<%=URLString%>','winName1');"><%=strName%></a>

    function popupOpen(winURL,winName) {
    winName1 = window.open(winURL,winName);
    }

    in jsp1or jsp2 or jsp3 i have a logout link at the top of the page,when i click logout link in any jsp it redirects to logout page and i also want the window which is opened to be closed.

    how can i do this,
    how to check a window is open or not in another jsp and if that window is open close it.

    Help needed

    Advance Thanks to all

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Well, you don't even have to do that!! All you would need to do is, in the onload section on the body, place a setTimeout function so that after five seconds, the window can close with window.close(). This is all you need to do: in the onload part of the body tag, place this in it: setTimeout("window.close()",5000); This makes the window close after five seconds. There is no need to check if it is open. Hope I helped.

    -magicyte

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for ur reply,

    but i dont close the window after a time out.

    when a user click logout link,the same page redirects to logoutURL and the new window which is open shud close.

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
  •