I would like to embed HTML code into a html page. The styles from the HTML embeded code is disturbing the complete layout, that´s why I want to use iframes. The problem is that there is no .html page to link to, because this HTML code is comming from the database. I have tryed something like:
<iframe>${htmlContent} </iframe>
Where ${htmlContent} contains a simple html content.
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
This answer assumes you’re able to strip out the
<html>and</html>tags from your stored HTML, and are able toHtmlEncodeit when placing into the your markup.Store the encoded HTML into something like a div…
So it looks something like…
Then use the following Javsacript, which will “HtmlDecode” (there is no native javascript function to do this unfortunately) and then place into the iframe