我知道这个问题已被问过太多次了,我已经尝试了各种选项,但我仍然无法使其正常工作。它在chrome,firefox,ie6,ie7上运行得非常好,但不知何故在ie8和ie9它在同一个窗口打开。我附上我的代码以供参考
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();
}
答案 0 :(得分:1)
我不是window.open错综复杂的专家,但是窗口打开行为部分取决于用户设置以及是否安装了弹出窗口阻止程序。
this question中的示例可能会有所帮助,如果您需要模态对话框。