如何在单击两个独立链接时打开两个独立的弹出窗口

How to open two separate pop-up windows on click of two separate links?

本文关键字:独立 两个 窗口 单击 链接      更新时间:2023-09-26

下面有一个javascript函数,它在点击jsp文件上提供的两个独立链接时被调用。

简而言之,此功能将打开一个新的弹出窗口。我想要的是当我点击这两个链接时,两个新的弹出窗口应该打开。

但现在的情况是这样的;我点击一个链接,它会打开一个新的弹出窗口,但现在我点击第二个链接,但它不会打开新的弹出窗,而是用这个链接详细信息刷新旧的弹出窗(点击链接1时打开)。

我不知道如何打开两个单独的弹出窗口

function showHelp(orgType) {
var pageLoc = '<%=helpURL%>bin/view/Main/?appSession=<%=request.getSession().getId()%  >&securityToken=<%=appUtility.getSecurityToken(session
   .getId(), login, custId)%>&appurl=<%=java.net.URLEncoder.encode((new java.net.URL(request.getScheme(),ip,request.getServerPort(), "")).toString() + request.getContextPath(), "ISO-8859-1")%>&custType='+custType+'&custName=<%=hostName%>';
 self.open (pageLoc,'ServicePopUp','height=600,width=800,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes'); 

}

您需要为每个窗口提供不同的名称来区分它们:

function showHelp(orgType, windowName) {
    ...
    self.open (pageLoc, windowName,'height=600,width=800,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes');
}

查看额外的参数以及它在open函数中的位置?您需要为这两个链接提供两个不同的名称。希望这能有所帮助!