• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Dynamically created iframes and javascript

Atheus

Diamond Member
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?
 
Back
Top