...

View Full Version : time loading and Iframe



archimede
01-19-2005, 08:15 AM
I write a script wich give the possibility to the user to choose which file will load into the iframe. After that, I transfer the information from the iframe into the HTML page using some DOM script

The problem is that the iframe take few miliseconds to load. I would like to make a stop to give the time to the iframe to load before doing the other operation. If there is not a delay the other operation will not work.
I tryed different way using time and setTimeout but nothing seems to work.
With the setTimeout it works but as we can not control the time of loading. It became very difficult to clear the Timeout.
If some one have an idea, it will help me tank you in advance

This script is the one i use to transfer the url to the iframe

function transfertFichier() {

document.getElementById("recupObjet").src=convertFile("chFile")
abc()
}

This script is one which I would like to do after the iframe have load.

function abc() {

document.body.innerHTML +=frames[0].document.body.innerHTML

}

Willy Duitt
01-19-2005, 10:33 AM
Try calling the abc function using the onload event of the iframe...



<iframe id="test" src="http://google.com" onload="alert('Has loaded')"></iframe>
<form>
<input type="button" value="Test" onclick="document.getElementById('test').src='http://microsoft.com'">
</form>


.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum