我有一个’打开’按钮,’计算’一个链接,应该在一个新的标签页打开。 我尝试使用:
window.open(url, '_blank');
但这打开了一扇新的窗户。
我还尝试了以下方法:
<form id="oform" name="oform" action="" method="post" target="_blank">
</form>
...
document.getElementById("oform").action = url;
document.getElementById("oform").submit();
但是,仍然会打开一个新窗口,而不是新的选项卡。
当对 target='blank'使用简单的 <a href...>时,链接将在新的选项卡中打开。
有解决办法吗?