<分区>
所以,这是我的代码:
函数 link1()
{
window.location.href="例子";
}
如何在JS中实现_blank功能?
干杯
(注意:我没有使用图书馆,也不打算使用 atm)
标签 javascript html target
<分区>
所以,这是我的代码:
函数 link1()
{
window.location.href="例子";
}
如何在JS中实现_blank功能?
干杯
(注意:我没有使用图书馆,也不打算使用 atm)
最佳答案
window.open 就可以了。
function link1()
{
window.open("http://www.example.com");
}
关于Javascript-如何在一个简单的链接中实现target=_blank,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21439428/