弹出窗口无法在IE7上打开 [英] Popup window not opening on IE7

查看:120
本文介绍了弹出窗口无法在IE7上打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Hi Javascript gurus, I have this Javascript code which is working fine on Firefox , but it is not working on IE 7. Any ideas why?

这是代码

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


推荐答案

你可能已经意识到IE正在给出错误无效的参数。

You may have realized that IE is giving the error "Invalid argument."

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

IE doesn't seem to like window names with spaces in them. Change 'Simple Test' to 'SimpleTest' etc.

这篇关于弹出窗口无法在IE7上打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆