0
<html>
<head>
</head>
<body>
<iframe id='smartPartFrame' src='data:text/html;charset=utf-8,<h1>inteGREAT</h1>' scrolling='no' width='1000px' height='70px'></iframe>

</body>
</html>

The above html code used to show h1 in iframe. Chrome, Firefox, Edge working fine. IE 11 is showing the error: the page cannot be displayed. I wants to set html directly in src not file path.

machine
  • 29
  • 1
  • 1
  • 7
  • Possible duplicate of [page is not loading inside the iframe in IE11](https://stackoverflow.com/questions/21695191/page-is-not-loading-inside-the-iframe-in-ie11) – Jax-p Sep 11 '17 at 11:10
  • @JaxCze: That question doesn't involve data URIs. The only thing it has in common with this question is that something in iframes doesn't work in Internet Explorer 11. – BoltClock Sep 11 '17 at 11:11

1 Answers1

1

Internet Explorer 11 does not support data URIs in iframes, nor any other way to embed HTML inline in an iframe.

The "intended" way to do this in the standard is with the srcdoc attribute, not the src attribute given a data URI, but browser support for srcdoc remains poor.

BoltClock
  • 630,065
  • 150
  • 1,295
  • 1,284