简体   繁体   中英

Popup are opening in same window instead of new popup window

I know this question has been asked too many times, and i have tried various options suggested, but i am still unable to get it working. Its working perfectly well on chrome, firefox, ie6, ie7 but somehow in ie8 and ie9 it opens in same window. I am attaching my code below for reference

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();
}

I'm no expert on the intricacies of window.open, but window opening behaviour will partly depend on user settings and whether popup blockers are installed.

The example in this question might help, if you want a modal dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM