Check if a popup window is already open before opening it using Jquery

前端 未结 5 1318
广开言路
广开言路 2021-02-08 11:44

I want to check if a popup window is already open , before I open the popup window. How do I get it done using Jquery?

Below is my code to open a new popup window :

5条回答
  •  名媛妹妹
    2021-02-08 12:18

    try this (you will know if the open window was called):

    var isOpen = "false";
    function OpenPopup()
    {
       if(isOpen == "false")
       {
             isOpen = "true"; 
             window.open("mystopchat.php?stat=1&session="+data['myid1']['session_id']  [i],"win1","width=500,height=500");
        }
    } 
    

提交回复
热议问题