Connecting Tech Pros Worldwide Help | Site Map

ONLOAD is there an afterLoad alternative (Iframe problem)

Rich
Guest
 
Posts: n/a
#1: Jul 23 '05
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
Berislav Lopac
Guest
 
Posts: n/a
#2: Jul 23 '05

re: ONLOAD is there an afterLoad alternative (Iframe problem)


Rich wrote:[color=blue]
> 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?[/color]

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.


Rich
Guest
 
Posts: n/a
#3: Jul 23 '05

re: ONLOAD is there an afterLoad alternative (Iframe problem)


"Berislav Lopac" <berislav.lopac@dimedia.hr> wrote in message news:<c62tnu$89b$1@ls219.htnet.hr>...[color=blue]
> Rich wrote:[color=green]
> > 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?[/color]
>
> If your iframe is named iframe:
>
> iframe.onload = functionYouWantToRunWhenTheIframeLoads;
>
> should do the trick.
>
> Berislav[/color]

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
Closed Thread


Similar JavaScript / Ajax / DHTML bytes