We have a plugin which displays content on other websites using an iFrame. In IE 8 and 9, if there's a <!DOCTYPE html>
in the parent's page, then the iframe loads, but its content remains blank.
Removing the DOCTYPE
from the parent solves this.
I can't go around telling all the people using the plugin not to use <!DOCTYPE html>
or to use something else, so I have to find another solution.
I own the code loading the iframe and the code inside the iframe, so any solution which is using these will be welcomed...
<!DOCTYPE>
, it might help you avoid overflowing IE. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<meta>
tag in your <head>
tags: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
<!-- saved from url=(0014)about:internet -->
Put it after the <!DOCTYPE HTML>
tag.
Turns out that the problem was using display: table on the iframe. In IE7 & 8 it caused the entire content to disappear completely. @rolory's meta tag solution solves this, but I was afraid that it may also cause issues with the parent's content.
Thanks everyone for the help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.