I have a script such as:
<script> document.body....make something and draw many things in the browser </script>
Which I'd like to execute sandboxed inside an iframe. How can I load this piece of javascript inside the iframe?
I'm trying that which does not work:
document.getElementById('previewFrame').contentWindow.document.body.innerHTML = "<script language='javascript'></script>";
Thanks.