I was having the following div in my HTML page:
<div id="jsmolwindow">
<script type="text/javascript">jmolApplet0 = Jmol.getApplet("jmolApplet0", Info);
</script>
</div>
I would like to create this div at an appropriate moment in one of my external javascript function.
I tried it this way:
var div = document.createElement("div");
div.style.position="absolute";
div.style.float="left";
div.style.top="200px";
div.style.left = "200px";
div.style.width = "150px";
div.style.height = "150px";
var scr = document.createElement('script');
scr.type = 'text/javascript';
scr.src = 'jmolApplet0 = Jmol.getApplet("jmolApplet0", Info);'
div.appendChild(scr);
document.body.appendChild(div);
Nothing happens. I tried to replace scr.src by scr.text but then it tried to execute my script in a new page and failed....
Thanks for you help.