Browser refresh causes loss of context

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PBong
    New Member
    • Feb 2010
    • 2

    Browser refresh causes loss of context

    Hi all,
    I have this weird problem while developping a website.. Hope somebody can shed some light on this...

    Main page has a frameset with onload() that calls a Javascript. This script sets up a collection of objects, say "Collection A".
    Frameset has two frames:
    - FrameA with navigation, onclick() which sets the SRC of FrameB
    - FrameB

    When click in FrameA, a HTML is loaded in FrameB. That HTML invokes a script that uses "Collection A", by using something like
    Code:
    abc = top.CollectionA; lencol = abc.length;
    All this works fine. When I now push the browsers refresh button, the script called by HTML in FrameB gets stuck on
    Code:
    abc.length
    Obviously, context of top.CollectionA has been lost. WHY ??? Debugging shows is still knows about top, its href, its own href etc.
    Funny thing is that - when I click in FrameA, FrameB is loaded and works correctly...

    Help !!!!!
  • PBong
    New Member
    • Feb 2010
    • 2

    #2
    Hierarchy

    Found why....
    F5 makes all frames reload their current source. For data context to work, these sources need to be invoked via the hierarchy.
    Moving the SRC of the Frame statement to a script invoked by the FRAMES onload() solves this problem.

    Comment

    Working...