![](/img/trans.png)
[英]Is there a way to open multiple links one by one into newtabs using javascript?
[英]Open Multiple Links in One Action Javascript/Jquery (not Popup)
我想在單個事件/單擊上打開多個URL,這也將轉到我指定的URL(我嘗試執行此操作,但似乎不起作用)。
html
<a id="mybutton" href="http://example.net/quote" onclick="url_open()">See Offer</a>
腳本
function url_open() {
window.open("http://example.net/events","_blank");
window.open("http://example.net/gallery","_blank");
alert('Check The Tabs');
}
我想做的是在單擊按鈕的同時向用戶發送報價頁面,同時打開兩個選項卡
PS在Firefox和IE中打開了兩個標簽,但在Chrome中未打開
瀏覽器具有內置的彈出窗口阻止程序,因此您可以在u當前所在的頁面上打開一個URL,並在新選項卡中打開一個URL。 嘗試:
function url_open() {
window.open("http://example.net/events",'_top');
window.open("http://example.net/gallery",'_blank');
alert('Check The Tabs');
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.