Javascript 弹出窗口在同一窗口中打开,而不是在新的弹出窗口中打开
我知道这个问题已经被问了太多次了,我也尝试了各种建议,但我仍然无法让它发挥作用。它在chrome、firefox、ie6、ie7上运行得非常好,但不知何故,在ie8和ie9中,它会在同一个窗口中打开。我在下面附上我的代码以供参考Javascript 弹出窗口在同一窗口中打开,而不是在新的弹出窗口中打开,javascript,html,internet-explorer,popup,Javascript,Html,Internet Explorer,Popup,我知道这个问题已经被问了太多次了,我也尝试了各种建议,但我仍然无法让它发挥作用。它在chrome、firefox、ie6、ie7上运行得非常好,但不知何故,在ie8和ie9中,它会在同一个窗口中打开。我在下面附上我的代码以供参考 function login(url){ var width = 550; var height = 300; console.log(screen.width); console.log(screen.height); var
function login(url){
var width = 550;
var height = 300;
console.log(screen.width);
console.log(screen.height);
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);
fconnect = window.open(url, "SignIn", "width=550, height=300, toolbar=0,\
scrollbars=0, status=0, resizable=0, \
top=" + top);
fconnect.focus();
}
我对window.open的复杂性并不在行,但窗口打开行为部分取决于用户设置和是否安装了弹出窗口阻止程序
如果您需要模式对话框,中的示例可能会有所帮助。不知怎的,我今天在ie上实现了它。无论如何,感谢您的回复。我不知道是什么改变了它。