I'm creating an iframe on the fly with javascript using the following code:
var editframe=document.createElement('iframe');
I set the source to another HTML file, then do various other things to it, including trying to set the contents of an internal div with this:
frames['edit_frame'].document.getElementById('container').innerHTML="foo";
which doesn't work. But. If I assign that line of code to a seperate event like this:
<a href="#" ******="frames['edit_frame'].document.getElementById('container').innerHTML='fooz'">foo</a>
and click it after the iframe creation funtion has returned, it does work. Why? It seems like the DOM is not being updated, how can I force the update?
var editframe=document.createElement('iframe');
I set the source to another HTML file, then do various other things to it, including trying to set the contents of an internal div with this:
frames['edit_frame'].document.getElementById('container').innerHTML="foo";
which doesn't work. But. If I assign that line of code to a seperate event like this:
<a href="#" ******="frames['edit_frame'].document.getElementById('container').innerHTML='fooz'">foo</a>
and click it after the iframe creation funtion has returned, it does work. Why? It seems like the DOM is not being updated, how can I force the update?