Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get window.open to work in internet explorer 7?

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?

like image 731
bluefear Avatar asked Jan 19 '09 20:01

bluefear


People also ask

Why can't I open a new tab in Internet Explorer?

Internet Explorer Blank Page However, if you'd rather a new tab open a blank page, here's how to set it. For IE 9 and IE 10, click the gear icon on the right side and select Internet Options. Under General, click the Tabs button. Under “When a New Tab is Opened,” change the option to open to: A Blank Page and click OK.

Does window open work in all browsers?

Normally yes it works everywhere however not all the features are supported by all browsers.


1 Answers

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:

"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."

like image 113
David Avatar answered Nov 14 '22 21:11

David