IFRAME Roger Rabbit

Let me save some lucky randomly-visiting developer a ton of time:

If you ever have to open a pop-up window from within an iframe, make sure you call it using onClick (not by href) or Internet Explorer won’t open it. IE will open it in the iframe or (sometimes) not at all. Either way seems to work in Firefox.

In summary:

INCORRECT:
<a href=”javascript:window.open(‘http://www.flawlesswalrus.com’, ‘newWin’, ‘width=300′)”>Click to pop</a>

CORRECT:
<a href=”void();” onclick=”window.open(‘http://www.flawlesswalrus.com’, ‘newWin’, ‘width=300′)”>Click to pop</a>

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>