Problems with innerHTML

G

Gustavo

I there!

I have the following problem:
I have a file named a.html that contains a iframe, a div and a
javascript function called loadFinish.
The function loadFinish will put the innerHTML of the iframe into the
innerHTML of the div. THIS WORKS FINE.

<!-- FILE A.HTML -->
<iframe style="DISPLAY:none" name="bufferClass"
onload="loadFinish('contentClass', 'bufferClass');" src="b.html">
</iframe>
<div id="contentClass"></div>

<script language=javascript>
function loadFinish(id1, id2) {
var html = document.frames['bufferClass'].document.body.innerHTML;
document.all['contentClass'].innerHTML = html;
}
</script>
<!-- EOF -->

This copies the innerHTML of the iframe into the innerHTML of the div.

The problem is in b.html. Here, I need to reload the iframe with the
src "c.html" and put it into the div.
The changes to the src of bufferClass are not taken into account when
the loadFinish function performs. It puts the innerHTML of b.html
instead of the innerHTML of c.html.

<!-- FILE B.HTML -->
<script language=javascript>
parent.bufferClass.src = "c.html";
loadFinish('contentClass', 'bufferClass');

function loadFinish(id1, id2) {
var html = document.frames['bufferClass'].document.body.innerHTML;
document.all['contentClass'].innerHTML = html;
}
</script>
<!-- EOF -->

NOTE: I cannot reload the page, in order to the iframe reload with new
scr. The only thing that can reload is the iframe.


Any ideas people?
Thanks
Gustavo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,082
Messages
2,570,587
Members
47,209
Latest member
Ingeborg61

Latest Threads

Top