IFrame content not showing in IE8

I have a website with iFrame.

There is very simple JS on the main page, there is simple JS on the iframed page.

When I embed the iframe as usual: <iframe src="iframeURL" width="900" height="1000"></iframe> it works fine in all browsers, but IE8.

I tried different things:

  • first: disable all js
  • removing the src attribute and adding it using JS
  • using <object> instead
  • I used proxy.php to make the content appear as if it came from the same domain

In IE8, it does not work no matter what I do.

The funny thing is that I can open the page where I want the iframe on a separate tab and works great.

If I change the src attribute to "some_other_random_page_from_internet", it works.

Itโ€™s another matter that both host and iframe use postMessage for communication, and I see that the communication works fine, itโ€™s just the content that doesnโ€™t appear, but when I check the source of the page using developer tools, I see the content.

Is it possible that the contents of the iframe are causing problems? This is basic HTML + basic JS, with JS disabled this should not be a problem.

Any ideas what else I could check?

PS. I can not show the code (NDA, etc.)

+3
source share
2 answers

To review Lukx's comment, the real answer is to set position:relative to the iframe itself, as you may not be able to edit the original html page or you may need to use relative positioning.

Just add this CSS and everything should be installed:

 iframe { position: relative; } 

I wrote a full description of the problem in this answer

+4
source

Found.

In the iframed content, there was the following css rule:

 html{ position: relative; } 

Removing this has helped a lot.

+10
source

All Articles