(code is at end of post)
-------------------------------------------
I'm using an i-frame to grab a server-side text file and display its content
elsewhere in the html document. On change of the i-frame source, I want to
access its innerHTML.
The i-frame source changes just fine and even displays the source; the glitch
is in accessing the innerHTML for that new i-frame src file. It requires *TWO*
clicks of the onClick element to get the correct innerHTML (with just one
click, the source will change, and display the new file in the html document;
however, the innerHTML is still that of the old source file for the i-frame).
This does not appear to be a loading problem with the new src file into the
i-frame. (ie: setTimeout on a function to get the innerHTML after the src file
loads does not work).
So the question is: how can I get the i-frame source to change AND access the
new src file's innerHTML with one click??
Ideas, suggestions, changes appreciated.
Thankyou,
Jim
------------------- C O D E -------------------
// framer is the new src file name for the i-frame;
// eyeframe is the i-frame element id
// myframe is the i-frame element name
// centerbox inner is the div container for the new content
function contentChange(framer){
document.getElementById('eyeframe').src = framer;
document.getElementById('centerboxinner').innerHTM L
=window.frames['myframe'].document.body.innerHTML
}