我一直在使用此代码的改编版本:
我已对其进行了调整,使其具有一个按钮来搜索多个网站..
<script>
function multiSearch(){
window.open (SEARCH URL A);
window.open (SEARCH URL B);
window.open (SEARCH URL B);
</script>
<input type="button" value="Latest Results" onClick="multiSearch;">
效果很好,但在 Chrome 中,只有第一个搜索窗口作为新选项卡打开,其他两个窗口作为弹出窗口打开。有没有办法让它们全部作为选项卡打开?
最佳答案
window.open(url, '_blank')
有时会在新选项卡中打开,但通常会在新窗口中打开,具体取决于它的使用方式。遗憾的是,您无法使用 Javascript 直接控制它。
关于javascript - window.open 作为选项卡在 Chrome 中不弹出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18811179/