Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    time loading and Iframe

    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

    }

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try calling the abc function using the onload event of the iframe...

    Code:
    <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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •