SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2006
    Posts
    190
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    close a window or two

    i have this function that closes a window

    function closeAll() {
    if (myWin && myWin.open && !myWin.closed)
    {
    myWin.close();
    }
    }

    how do i work in antoher window in there "myOtherWin" so that when this function is called both windows are closed myWin and myOtherWin, regardless which or both are opened?

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you simply pass the window name as an argument to the function and use the variable? If i have come to understand about your problem here is what i mean:
    Code:
    function closeAll(varWin) {
    if (varWin && varWin.open && !varWin.closed)
    {
    myWin.close();
    }
    }
    Let me know whether i understood the problem or not.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •