Calling function in oyher frame

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

    Calling function in oyher frame

    Hi everybody,

    I met an interesting problem.

    On my site people can browse through many pages that are viewed in a set of
    frames.
    Now I would like to avoid reloading the rather large .js file everytime a
    new page is viewed. (takes a few seconds on an ordinary telephone
    connection).
    Therefore I load it at the central entry-point once when I fill the frame
    kop (referred to as 'top.kop').

    Now from the different other frames, when they are loaded, they call a
    setup-routine with:
    <BODY ONLOAD="top.kop .setup(document )">

    This works fine in IE, but not in NN 7.0

    NN does not recognise setup() as a function available in top.kop

    How come and what can be done about it...

    By the way, merry Christmas, everybody!!!
    Don't give up your family-life for questions like the above...


  • Eric Bohlman

    #2
    Re: Calling function in oyher frame

    "Peter Crom" <pacrom@bart.nl > wrote in
    news:rsXFb.1775 $Ax3.4858@typho on.bart.nl:
    [color=blue]
    > On my site people can browse through many pages that are viewed in a
    > set of frames.
    > Now I would like to avoid reloading the rather large .js file
    > everytime a new page is viewed. (takes a few seconds on an ordinary
    > telephone connection).[/color]

    You can achieve that by linking to the script (<script src="...">) rather
    than including its source in the individual pages. That way it will be
    cached the first time it's loaded. It will also make maintaining the
    script easier, since any changes only have to be made in one place.

    Comment

    • Brian Genisio

      #3
      Re: Calling function in oyher frame

      Peter Crom wrote:
      [color=blue]
      > Hi everybody,
      >
      > I met an interesting problem.
      >
      > On my site people can browse through many pages that are viewed in a set of
      > frames.
      > Now I would like to avoid reloading the rather large .js file everytime a
      > new page is viewed. (takes a few seconds on an ordinary telephone
      > connection).
      > Therefore I load it at the central entry-point once when I fill the frame
      > kop (referred to as 'top.kop').
      >
      > Now from the different other frames, when they are loaded, they call a
      > setup-routine with:
      > <BODY ONLOAD="top.kop .setup(document )">
      >
      > This works fine in IE, but not in NN 7.0
      >
      > NN does not recognise setup() as a function available in top.kop
      >
      > How come and what can be done about it...
      >
      > By the way, merry Christmas, everybody!!!
      > Don't give up your family-life for questions like the above...
      >
      >[/color]

      This is because, if the frame is named "kop", you need to use the more
      cross-browser way to access it (the other notation is specific to IE):

      top.frames["kop"] ... which yields top.frames["kop"].setup(document )

      Hope I got it right... without seeing the code, it is difficult to tell
      for sure.

      Brian

      Comment

      Working...