How to set the focus to a child window without refreshing it?

后端 未结 2 1235
礼貌的吻别
礼貌的吻别 2021-01-14 01:08

I am having a web page which contain four links, each link open a popup window. I am using a common JavaScript function to open popup window, as given below

         


        
2条回答
  •  灰色年华
    2021-01-14 01:14

    I think what you want for 1 and 2 is:

    if(!targetWin)
    {
        var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, 
            directories=no, status=no, menubar=no, scrollbars=Yes, resizable=no, 
            copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
    }
    targetWin.focus();
    

提交回复
热议问题