简体   繁体   English

window.open无法在Chrome中使用浏览器后退按钮打开

[英]window.open doesn't open with browser back button in Chrome

I am trying to open a link in new window using a simple window.open . 我试图使用一个简单的window.open在新窗口中打开一个链接。

However I want the browser back button, so I give the below parameters. 但是我想要浏览器后退按钮,所以我给出了以下参数。 It works fine in all browsers except Google Chrome. 它适用于除谷歌浏览器以外的所有浏览器。 I have tried almost every possible permutation but the back button doesn't come up in Chrome: 我已经尝试了几乎所有可能的排列,但后退按钮没有出现在Chrome中:

<a onclick="window.open('http://www.google.com',
                        'popUpWindow',
                        'height=500,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=yes,directories=no, status=yes'
                       );">Click Here</a>

Change menubar=no to menubar=yes , here is the code. menubar=no更改为menubar=yes ,这是代码。

NOTE : It will not open as pop up, it will open as a new tab. 注意 :它不会弹出,它将作为新选项卡打开。

<a onclick="window.open('http://www.google.com',
                        'popUpWindow',
                        'height=500,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes,directories=no, status=yes'
                       );">Click Here</a>

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

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