gpt4 book ai didi

javascript - 同时弹出并更改位置

转载 作者:行者123 更新时间:2023-11-28 02:58:50 26 4
gpt4 key购买 nike

基本上这是我的代码(Authenticator.jsp):

window.location.replace("Login.html"); // replace method also takes care of history
window.open ("Main.html", "Welcome logged in user");

预期行为:

  1. 一旦用户登录,我们基本上会在弹出窗口中打开 Main.html。
  2. 当前窗口必须指向 Login.html,并且 main 应在弹出窗口中打开。

实际行为:

  1. Main.html 在弹出窗口中打开
  2. Authenticator.jsp 切换回 Login.html,但是此窗口获得焦点!并显示在我的弹出窗口前面!!

这个问题有解决办法吗?此行为在 IE6 中出现(我没有检查 IE7 和 IE8),在 Firefox 和 chrome 中不会出现

最佳答案

我认为你应该打电话

window.location = "Login.html"

然后将调用移至

window.open("Main.html","欢迎登录用户");

进入Login.html页面的onload事件。

关于javascript - 同时弹出并更改位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1788475/

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