[英]How do I make multiple tabs open in a new window?
I use this script to create a button which opens the 3 links in new tabs, but in the same window 我使用此脚本创建一个按钮,该按钮在新选项卡中打开3个链接,但在同一窗口中
<html><head>
<script type="text/javascript">
function open_win()
{
window.open("https://google.com/")
window.open("https://www.gmail.com/")
window.open("https://www.facebook.com/")
}
</script></head>
<body>
<form> <input type=button value="Start a Blog" onclick="open_win()"> </form>
</body> </html>
I found another code to open a link in new window of 300*250. 我找到了另一个代码来在300 * 250的新窗口中打开链接。
<a href="https://google.com/" onclick= "window.open('https://google.com/','newwindow','width=300,height=250');
return false;"> </a>
Now , I want to combine these two. 现在,我想将两者结合起来。 I want a button as in the first case, to open a new window of 300*250 and then open the three links in new tabs in that window.
与第一种情况一样,我想要一个按钮来打开300 * 250的新窗口,然后在该窗口的新选项卡中打开三个链接。
You can't. 你不能
window.open
can create two different kinds of windows, depending on whether certain options are specified in the third argument: window.open
可以创建两种不同类型的窗口,具体取决于第三个参数中是否指定了某些选项:
Normal browsing windows (which most modern browsers will open in tabs of the current window) 普通浏览窗口(大多数现代浏览器将在当前窗口的选项卡中打开)
Popup windows (which cannot contain tabs) 弹出窗口(不能包含选项卡)
There is no way to "mix and match" these two options. 没有办法“混合和匹配”这两个选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.