如何通过点击两个单独的链接打开两个单独的弹出窗口?

时间:2012-01-27 10:05:45

标签: java javascript html jsp

我有一个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'); 

}

1 个答案:

答案 0 :(得分:3)

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

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

请参阅额外参数及其适合open函数的位置?您需要为这两个链接提供2个不同的名称。希望这有帮助!