1

I try to close child popup from a button on parent window. Below is the function used for it.But it doesn't work fine with IE, it works fine with firefox. Sometimes child popup gets closed on first time but when you reopen the popup and try to close it doesn't close. And generally it doesn't work at all.

If i debug by alerts then "!fenetreOuverteConf.closed" is false. But it's value is true with firefox.

function closePopup(){
    var motherCOnf = (opener?opener:parent);
    var fenetreOuverteCOnf = motherCOnf.window['childPopup'];
    if(fenetreOuverteCOnf && !fenetreOuverteConf.closed)
    {
        fenetreOuverteCOnf.close();
    }
}
skaffman
  • 398,947
  • 96
  • 818
  • 769
Rohit
  • 11
  • 2

1 Answers1

0

It may be because you have fenetreOuverteCOnf and fenetreOuverteConf - note the difference in capitalization of the "o" in "conf". Javascript variables are cAsE sEnSiTiVe!

Chris Baker
  • 49,926
  • 12
  • 96
  • 115
  • oops sorry it's my fault.. copy paste problem.. this is what i use in my code "if(fenetreOuverteConf && !fenetreOuverteConf.closed)" . – Rohit Aug 18 '11 at 10:30
  • It works fine with firefox .. only problem is with IE.. it works sometimes in IE and sometimes it doesn't work.. – Rohit Aug 18 '11 at 10:32