GrimChild
09-14-2005, 11:23 PM
Occasionally I Need Help, And I Cant Find It Anywhere Else...
So Anyhow, I have an IFRAME in an HTML page.
<iframe id="filegetter" name="filegetter" src=""></iframe>
and i have A bit of mr Javascript As Well
<script>
fgdoc=document.getElementById("filegetter");
function cin(){
url="file_to_get.txt";
filegetter.location.replace(url);
fgdoc.onreadystatechange=function chkld(){
if(fgdoc.readyState=="complete"){
alert(filegetter.document.body.innerText);
setTimeout('cin()',2000);
}
}
}
cin();
</script>
Yes.. Theres A Function Inside A Function.
Works Great In IE (As Usual );
What It Should Do...
the javascript function cin() is called;
the IFRAMEs location is changed (it Will be Different);
the IFRAME's status is checked and if it returns "complete"
Alert the Contents of the file (just for testing);
In all actuality, all i need to do is check if the IFRAME's current page location is fully loaded and if so, get the contents of the IFRAME's document.body
Am I Going About This The Hard Way ?
Is There A Cross-Browser Compatible Way To Do It ?
As Usual,
Thanx 2-N-E-N All That Reply
So Anyhow, I have an IFRAME in an HTML page.
<iframe id="filegetter" name="filegetter" src=""></iframe>
and i have A bit of mr Javascript As Well
<script>
fgdoc=document.getElementById("filegetter");
function cin(){
url="file_to_get.txt";
filegetter.location.replace(url);
fgdoc.onreadystatechange=function chkld(){
if(fgdoc.readyState=="complete"){
alert(filegetter.document.body.innerText);
setTimeout('cin()',2000);
}
}
}
cin();
</script>
Yes.. Theres A Function Inside A Function.
Works Great In IE (As Usual );
What It Should Do...
the javascript function cin() is called;
the IFRAMEs location is changed (it Will be Different);
the IFRAME's status is checked and if it returns "complete"
Alert the Contents of the file (just for testing);
In all actuality, all i need to do is check if the IFRAME's current page location is fully loaded and if so, get the contents of the IFRAME's document.body
Am I Going About This The Hard Way ?
Is There A Cross-Browser Compatible Way To Do It ?
As Usual,
Thanx 2-N-E-N All That Reply