我在 JSP 页面上使用下面的 anchor 标记从同一个应用程序打开另一个页面,但是新窗口没有在同一个 session 中打开,而是重定向到我的应用程序的登录页面。有什么线索吗?
<a href="#" onclick="window.open('/path_to_same_page', '_blank',
'toolbar=0,status=0,resizable=1'); return false;">Click here...</a>
最佳答案
试试这个解决方法,不确定它是否有帮助,但值得一试:
<a href="/path_to_same_page" target="mywindow" onclick="window.open('/path_to_same_page', 'mywindow', 'toolbar=0,status=0,resizable=1');">Click here...</a>
有了这个,窗口最初不会由脚本打开,而是由 target
属性打开。
关于javascript - window.open 未在同一 session 中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6580550/