JavaScript在新窗口打开链接后跳转到新窗口
<script>
var mp3 = 'https://example.com/somefile.mp3';
var newWindow = window.open(mp3, '_blank');
newWindow.onload = function() {
window.location.href = newWindow.location.href;
};
</script>
<p>这段代码会在新窗口中打开 'https://example.com/somefile.mp3' 链接,并在新窗口加载完成后将当前窗口重定向到新窗口的URL。请将 'https://example.com/somefile.mp3' 替换为你要打开的链接。</p>
原文地址: https://www.cveoy.top/t/topic/p27f 著作权归作者所有。请勿转载和采集!