ONLOAD is there an afterLoad alternative (Iframe problem)

R

Rich

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
 
B

Berislav Lopac

Rich said:
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
 
R

Rich

Berislav Lopac said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top