...

View Full Version : alternative to <iframe onload=....>



aprestong
05-17-2007, 02:38 AM
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?

smalldog
05-17-2007, 04:52 AM
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?

aprestong
05-17-2007, 02:49 PM
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?

glenngv
05-17-2007, 04:50 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum