gpt4 book ai didi

javascript - 只需在 window.open 中仅打开一个选项卡

转载 作者:行者123 更新时间:2023-11-28 18:28:44 24 4
gpt4 key购买 nike

例如,我的 html 文件:

<script>
window.open('http://stackoverflow.com/');
</script>

run my file 。我希望只打开 Stack Overflow 选项卡。我不希望在打开 Stack Overflow 选项卡之前使用该选项卡。我必须做什么?无需使用服务器。

最佳答案

使用window.location.href在当前选项卡中加载。

window.location.href='http://stackoverflow.com';

关于javascript - 只需在 window.open 中仅打开一个选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38562028/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com