gpt4 book ai didi

php - Window.open 在另一个弹出窗口中不起作用

转载 作者:行者123 更新时间:2023-11-30 18:01:54 26 4
gpt4 key购买 nike

我有一个使用 javascript window.open() 生成的弹出窗口“X”。当我尝试从弹出窗口“X”打开另一个子窗口“Y”时,我得到了一个弹出窗口“Y”以及重新加载到原始浏览器窗口的“X”的 url。谁能帮我解决这个问题?

最佳答案

我试过这个,它对我有用:

function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<button class='hi' onclick='window.open()'> hi!</button>");
myWindow.focus();
}
<input type="button" value="Open window" onclick="openWin()" />

关于php - Window.open 在另一个弹出窗口中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16767805/

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