你如何获得window.open在Internet Explorer 7中工作? [英] How do you get window.open to work in internet explorer 7?

查看:130
本文介绍了你如何获得window.open在Internet Explorer 7中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去3个小时我一直试图让我的svg网站打开弹出窗口,而我所得到的只是Internet Explorer中的Permission Denied错误。我已经尝试了在谷歌上找到的一切,但没有任何效果。我甚至只是在没有参数的情况下调用window.open()为空,并且仍然获得了权限被拒绝错误。什么是目前在Internet Explorer中打开弹出窗口的标准...有效吗?

I've been trying for the past 3 hours to get my svg web site to open popups, and all I ever get is "Permission Denied" errors in internet explorer. I've tried everything I could find on google, and nothing works. I've even gone to the point of just calling window.open() blank with no parameters, and still get a permission denied error. What is the currently accepted standard for opening popups in internet explorer... that works?

推荐答案

这是安全性变化的一部分在IE6中制作。现在,您只能在用户启动的事件中调用window.open。例如,您的代码将在元素的onclick事件中起作用。 window.openMSDN页面说这个:

This is part of the security changes made in IE6. Now you can only call "window.open" from within a user-initiated event. For example, your code would work inside an element's onclick event. The "window.open" MSDN page says this:


此方法必须使用用户启动的
操作,例如点击链接或
选中一个链接并按Enter键,
打开一个弹出窗口.Internet Explorer 6中的弹出式
Blocker功能
阻止在没有
被启动的情况下打开的窗口由用户。

"This method must use a user-initiated action, such as clicking on a link or tabbing to a link and pressing enter, to open a pop-up window. The Pop-up Blocker feature in Internet Explorer 6 blocks windows that are opened without being initiated by the user."

这篇关于你如何获得window.open在Internet Explorer 7中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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