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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    110
    Thanks
    1
    Thanked 0 Times in 0 Posts

    alternative to <iframe onload=....>

    Hi everyone -
    I'm using an iframe with a GET variable to execute a php script that could take up to a minute to execute - I'm calling the DIV containing the iframe via an AJAX script -
    I'd like to display a nice loading bar .gif and when the iframe is loaded use innerHTML to change my "status" div that is above the div containing the iframe.

    <iframe onload=..> works perfectly fine in IE and Firefox - but safari won't support the iframe onload event.
    is there a way to accomplish this? I basically want to change the innerHTML of my "status" div when the iframe is finished loading - of course I can't call parent.getElementById from the document in my iframe because the page the iframe is loading is not in the same domain.

    I'm not having any luck with window.onload, either - but I don't know if that is even an acceptable substitute.

    Anyone have any suggestions?

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi aprestong, you say you are using iframe with a get variable to execute a php script, isn't better to use just AJAX to perform that http request?
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #3
    Regular Coder
    Join Date
    Jul 2006
    Posts
    110
    Thanks
    1
    Thanked 0 Times in 0 Posts
    The source of my iframe is outside my domain - so I used the iframe as a way around the "Same as Origin" security rule.
    Is this a good method?

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Since the page in the iframe is not in the same domain as yours, you may be out of luck of solving this without using the iframe onload. Anyway, the browser status bar will display the loading status of the iframe.


  •  

    Posting Permissions

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