![](/img/trans.png)
[英]Using target_blank to open a new tab on click - can I load a new page in the original tab automatically?
[英]How to open a page in a new tab using an id and target _blank
如何使用id
和目標_blank
在新選項卡中打開頁面:
let id = 323;
window.open('edit.php?id=' + id + ',' + '_blank');
結果 - edit.php?id=323,_blank
我需要 - edit.php?id=323
謝謝。
你的串聯邏輯是錯誤的。 像這樣做。
window.open('edit.php?id=' + id, '_blank');
將“_blank”作為第二個參數傳遞。 不要連接它。
將“_blank”作為第二個參數傳遞給window.open
let id = 323;
window.open('edit.php?id=' + id, '_blank');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.