Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用现有名称一次又一次地打开新选项卡?_Javascript_Jquery_Jsp - Fatal编程技术网

Javascript 如何使用现有名称一次又一次地打开新选项卡?

Javascript 如何使用现有名称一次又一次地打开新选项卡?,javascript,jquery,jsp,Javascript,Jquery,Jsp,我正在开发Web应用程序 在home.jsp中,我使用javaScript打开新选项卡 Java脚本 var newtabWin = null; function openNewTab(myPagePath, myPageName) { newtabWin = window.open(myPagePath, myPageName); } <commandLink id="newtabEntryId" onclick="openNewTab('./../set

我正在开发Web应用程序

在home.jsp中,我使用javaScript打开新选项卡

Java脚本

var newtabWin = null;
function openNewTab(myPagePath, myPageName)
{
 newtabWin = window.open(myPagePath, myPageName); 
}

<commandLink id="newtabEntryId"
             onclick="openNewTab('./../settl/internalStatusviewer.jsp','internalStatusviewer');"            
</commandLink>
var newtabWin=null;
函数openNewTab(myPagePath、myPageName)
{
newtabWin=window.open(myPagePath,myPageName);
}

window.open的第二个参数接受选项卡的“windowName”。您可以自由地将其定义为任何文本,例如“index_user1”或“payments_user1”或“index_user1_session_123”。当您给出相同的文本时,该选项卡将被重用。如果您提供不同的文本,将打开一个新选项卡。有了这些信息,你应该能够做你想做的事情

例如,见


(如果您想要会话范围选项卡,不要在windowName中使用用户的真实会话ID)

如果我理解了这个问题,您希望同一个用户会话重用他打开的选项卡,但是对于来自同一浏览器的同一用户的另一个会话,您需要不同的选项卡?@EskoPiirainen是,我需要在不同的选项卡中打开,但它在相同的选项卡中重新加载你是正确的,如果我们更改窗口的名称,那么我们可以获得新的选项卡……然后一个页面可以多次打开,所以同一页面可以多次访问对不对,,,我不需要这样做