1
Hello
I need to use a variable that contains my HTML code to display within a iframe
, but my page does not display. What may be wrong ?
My code:
<html>
<head><title></title></head>
<script type="text/javascript">
function prepareFrame() {
var bodycode =
"<html><head><title>" +
"Teste</title></head>" +
"<body>teste</body></html>" // ESSE E O HTML
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", bodycode); // AQUI TENTO INSERIR NO IFRAME
ifrm.style.width = "500px";
ifrm.style.height = "500px";
document.body.appendChild(ifrm);
}
</script>
<body>
<script type="text/javascript">prepareFrame();</script>
</body>
</html>
Thank you
Thanks for the help
– user171274