简体   繁体   English

当我在IE9中使用window.open时,会话丢失

[英]session is lost when i use window.open in IE9

I'm using window.open to open a new window and this is my code sample 我正在使用window.open打开一个新窗口,这是我的代码示例

var path = '<%=request.getContextPath()%>';
var page = path+"/jsp/displayCompareResult.jsp";
window.open(page, 'displayCompareResult','');

This works absolutely fine in IE8, but in IE9 window.open gets created in new session. 这在IE8中绝对可以正常工作,但在IE9 window.open中会在新会话中创建。 My application runs only on IE browser. 我的应用程序仅在IE浏览器上运行。

它也发生在我的Chrome中。我通过添加解决了此问题

<link rel="shortcut icon" href="../../img/favicon.ico"> 

If "new session" means that IE is opening your window to the new tab, your have to change this setting. 如果“新会话”表示IE正在向新标签页打开窗口,则必须更改此设置。 It is found in IE Settings General-tab (the leftmost tab) and above the last field there is a field called Tabs (or sth). 它位于“ IE设置”的“常规”选项卡(最左侧的选项卡)中,在最后一个字段的上方有一个称为“选项卡”(或sth)的字段。 Click Settings-button in this field, and in opened window you can find a field called Pop-up windows. 单击该字段中的“设置”按钮,然后在打开的窗口中找到一个名为“弹出窗口”的字段。 Pick "Open pop-up windows in new window" and save settings. 选择“在新窗口中打开弹出窗口”并保存设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM