我有一个来自第三方开发者的JavaScript文件.它有一个链接,可以用目标替换当前页面.我想用一个新标签打开这个页面.
这就是我到目前为止所掌握的情况:
if (command == 'lightbox') {
location.href="https://support.wwf.org.uk/earth_hour/index.php?type=individual";
}
有谁能帮帮我吗?
我有一个来自第三方开发者的JavaScript文件.它有一个链接,可以用目标替换当前页面.我想用一个新标签打开这个页面.
这就是我到目前为止所掌握的情况:
if (command == 'lightbox') {
location.href="https://support.wwf.org.uk/earth_hour/index.php?type=individual";
}
有谁能帮帮我吗?
window.open(
'https://support.wwf.org.uk/earth_hour/index.php?type=individual',
'_blank' // <- This is what makes it open in a new window.
);