ONLOAD is there an afterLoad alternative (Iframe problem)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rich

    ONLOAD is there an afterLoad alternative (Iframe problem)

    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

    #2
    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 = functionYouWant ToRunWhenTheIfr ameLoads;

    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.


    Comment

    • Rich

      #3
      Re: ONLOAD is there an afterLoad alternative (Iframe problem)

      "Berislav Lopac" <berislav.lopac @dimedia.hr> wrote in message news:<c62tnu$89 b$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 = functionYouWant ToRunWhenTheIfr ameLoads;
      >
      > should do the trick.
      >
      > Berislav[/color]

      Cheers Berislav,

      But.... the code doesn't understand that when I do iframe.onload =
      functionYouWant ToRunWhenTheIfr ameLoads; 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

      Comment

      Working...