弹出窗口无法在IE7上打开

Shi*_*iva 1 javascript internet-explorer popup

嗨Javascript大师,我有这个Javascript代码,它在Firefox上工作正常,但它不适用于IE 7.任何想法为什么?

这是代码

function TestWindow()
{
     SimpleWindow('Default.aspx', 'Simple Test', 200, 200, 'yes')
}

function SimpleWindow(mypage,myname,w,h,scroll)
{

    var win= null;

    var winl = (screen.width-w)/2;


    var wint = (screen.height-h)/2;

    settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'

    win=window.open(mypage,myname,settings)

    if(parseInt(navigator.appVersion) >= 4)
        {
            win.window.focus();
        }
    }
Run Code Online (Sandbox Code Playgroud)

Ate*_*ral 5

您可能已经意识到IE正在提供错误"无效参数".

IE似乎不喜欢带有空格的窗口名称.将"简单测试"更改为"SimpleTest"等.