Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorgilray
    • CommentTimeNov 2nd 2006
     
    I'm making an instant messaging program with AJAX. I have it so when someone sends someone it opens a chat window with for example the name: im_window_18

    That works, however, if the user already has the window open, I don't want it to try to open it, so I need to know if the window is already open.

    I tried this, but it didn't work:

    if(document.getElementByID('im_window_18').closed)
    {
    //PopUp Window
    }
  1.  
    Try this


    //declare the variable outside your window open function
    var im_window_18;

    function createPopUp(URL){
       if(im_window_18==null || typeof(im_window_18)=="undefined"){
             im_window_18.focus()
        } else {
         //create your window
       }
    }