<iframe id="frameID" width="200" height="200" srcdoc="<html><body></body></html>"></iframe>
<script>
var hello = 'hello';
window.onload = function() {
var script = "<script type=\"text\/javascript\" src=\"script.js\" async=\"async\"><\/script>";
$('#frameID').contents().find('body').append(script);
}
</script>