By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,652 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,652 IT Pros & Developers. It's quick & easy.

ONLOAD is there an afterLoad alternative (Iframe problem)

P: n/a
Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?

Richard
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rich wrote:
Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?


If your iframe is named iframe:

iframe.onload = functionYouWantToRunWhenTheIframeLoads;

should do the trick.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 23 '05 #2

P: n/a
"Berislav Lopac" <be************@dimedia.hr> wrote in message news:<c6**********@ls219.htnet.hr>...
Rich wrote:
Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?


If your iframe is named iframe:

iframe.onload = functionYouWantToRunWhenTheIframeLoads;

should do the trick.

Berislav


Cheers Berislav,

But.... the code doesn't understand that when I do iframe.onload =
functionYouWantToRunWhenTheIframeLoads; what 'iframe' is. I have named
it iframe. Its using "Load balancing" so it can potentially be using 4
different iframes so therefore doesn't know which server the content
for the iframe is coming from. So it sees the iframe as null and sets
the iframe scrollbar to size.

Is there any way of discovering which server the iframe content is
coming from then using it to measure its height and resize the screen?

Rich
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.