refreshing iframes causes problem

Discussion in 'HTML' started by Jarrod, Apr 25, 2004.

  1. Jarrod

    Jarrod Guest

    Hi all,

    I have a bit of a problem.

    I have several iframes in a page which load successively after the parent
    page loads. The idea was to load all my javascript objects and data THEN
    load the pages that need the data after that. It works fine the on the first
    load, but when you refresh or navigate back then forward, all of the frames
    and main page seem to loading at once, which causes an error because the
    iframes are trying to access data that essentially doesn't exist yet. I have
    tried things like checking for the data and relocating if it doesn't exist,
    but that then puts the page in the history.

    What I want to happen is for the main page to reload/refresh as it would the
    first time. It there a way to "turn off" the frame or something (sorry that
    is stupid terminology, but...well you know.)

    Also, something that might be linked. I have put alerts in some of the pages
    and they seem to be getting loaded more than once. I don't quite get what is
    happening, but I think that the fundamental problem is that I don't
    understand how the loading of frames work.

    Any help would be appreciated,

    Jarrod
    Jarrod, Apr 25, 2004
    #1
    1. Advertising

  2. Jarrod

    SpaceGirl Guest

    "Jarrod" <> wrote in message
    news:RwLic.54$zc3.50@newsfe1-win...
    > Hi all,
    >
    > I have a bit of a problem.
    >
    > I have several iframes in a page which load successively after the parent
    > page loads. The idea was to load all my javascript objects and data THEN
    > load the pages that need the data after that. It works fine the on the

    first
    > load, but when you refresh or navigate back then forward, all of the

    frames
    > and main page seem to loading at once, which causes an error because the
    > iframes are trying to access data that essentially doesn't exist yet. I

    have
    > tried things like checking for the data and relocating if it doesn't

    exist,
    > but that then puts the page in the history.
    >
    > What I want to happen is for the main page to reload/refresh as it would

    the
    > first time. It there a way to "turn off" the frame or something (sorry

    that
    > is stupid terminology, but...well you know.)
    >
    > Also, something that might be linked. I have put alerts in some of the

    pages
    > and they seem to be getting loaded more than once. I don't quite get what

    is
    > happening, but I think that the fundamental problem is that I don't
    > understand how the loading of frames work.
    >
    > Any help would be appreciated,
    >
    > Jarrod



    Sounds to me like you should move all the data from client- to server-side
    and loose all these issues. You could assign all the data to variables in
    whichever server side language your hosts supports, and have each frame read
    the contents of these variables (or, pass them as querystring variables
    between each frame). There are plenty of ways of doing this, but trying to
    manipulate data client side is asking for trouble. If the users browser
    behaves slightly differently, or they have script blocking turned on, what
    happens to your page? If you handle all your data server side, then there's
    not much the user can do to f*ck up your design.
    SpaceGirl, Apr 25, 2004
    #2
    1. Advertising

  3. Jarrod

    Jarrod Guest

    Thanks for the info. I will take it onboard (not that I live in a boat). My
    last design was serverside, and I was just trying to minimise http request
    and download of web content, but I guess I will have to go back and re-jig
    the old model.

    Do you have any ideas on the actual problem of reloading frame pages? It is
    kind of annoying me anyway apart from my problem.

    Thanks again Spacegirl!


    "SpaceGirl" <> wrote in message
    news:c6g2ou$bi91p$-berlin.de...
    >
    > "Jarrod" <> wrote in message
    > news:RwLic.54$zc3.50@newsfe1-win...
    > > Hi all,
    > >
    > > I have a bit of a problem.
    > >
    > > I have several iframes in a page which load successively after the

    parent
    > > page loads. The idea was to load all my javascript objects and data THEN
    > > load the pages that need the data after that. It works fine the on the

    > first
    > > load, but when you refresh or navigate back then forward, all of the

    > frames
    > > and main page seem to loading at once, which causes an error because the
    > > iframes are trying to access data that essentially doesn't exist yet. I

    > have
    > > tried things like checking for the data and relocating if it doesn't

    > exist,
    > > but that then puts the page in the history.
    > >
    > > What I want to happen is for the main page to reload/refresh as it would

    > the
    > > first time. It there a way to "turn off" the frame or something (sorry

    > that
    > > is stupid terminology, but...well you know.)
    > >
    > > Also, something that might be linked. I have put alerts in some of the

    > pages
    > > and they seem to be getting loaded more than once. I don't quite get

    what
    > is
    > > happening, but I think that the fundamental problem is that I don't
    > > understand how the loading of frames work.
    > >
    > > Any help would be appreciated,
    > >
    > > Jarrod

    >
    >
    > Sounds to me like you should move all the data from client- to server-side
    > and loose all these issues. You could assign all the data to variables in
    > whichever server side language your hosts supports, and have each frame

    read
    > the contents of these variables (or, pass them as querystring variables
    > between each frame). There are plenty of ways of doing this, but trying to
    > manipulate data client side is asking for trouble. If the users browser
    > behaves slightly differently, or they have script blocking turned on, what
    > happens to your page? If you handle all your data server side, then

    there's
    > not much the user can do to f*ck up your design.
    >
    >
    Jarrod, Apr 25, 2004
    #3
  4. Jarrod

    SpaceGirl Guest


    >
    > "SpaceGirl" <> wrote in message
    > news:c6g2ou$bi91p$-berlin.de...
    > >
    > > "Jarrod" <> wrote in message
    > > news:RwLic.54$zc3.50@newsfe1-win...
    > > > Hi all,
    > > >
    > > > I have a bit of a problem.
    > > >
    > > > I have several iframes in a page which load successively after the

    > parent
    > > > page loads. The idea was to load all my javascript objects and data

    THEN
    > > > load the pages that need the data after that. It works fine the on the

    > > first
    > > > load, but when you refresh or navigate back then forward, all of the

    > > frames
    > > > and main page seem to loading at once, which causes an error because

    the
    > > > iframes are trying to access data that essentially doesn't exist yet.

    I
    > > have
    > > > tried things like checking for the data and relocating if it doesn't

    > > exist,
    > > > but that then puts the page in the history.
    > > >
    > > > What I want to happen is for the main page to reload/refresh as it

    would
    > > the
    > > > first time. It there a way to "turn off" the frame or something (sorry

    > > that
    > > > is stupid terminology, but...well you know.)
    > > >
    > > > Also, something that might be linked. I have put alerts in some of the

    > > pages
    > > > and they seem to be getting loaded more than once. I don't quite get

    > what
    > > is
    > > > happening, but I think that the fundamental problem is that I don't
    > > > understand how the loading of frames work.
    > > >
    > > > Any help would be appreciated,
    > > >
    > > > Jarrod

    > >
    > >
    > > Sounds to me like you should move all the data from client- to

    server-side
    > > and loose all these issues. You could assign all the data to variables

    in
    > > whichever server side language your hosts supports, and have each frame

    > read
    > > the contents of these variables (or, pass them as querystring variables
    > > between each frame). There are plenty of ways of doing this, but trying

    to
    > > manipulate data client side is asking for trouble. If the users browser


    > > behaves slightly differently, or they have script blocking turned on,

    what
    > > happens to your page? If you handle all your data server side, then

    > there's
    > > not much the user can do to f*ck up your design.
    > >
    > >



    "Jarrod" <> wrote in message
    news:AwWic.229$...
    > Thanks for the info. I will take it onboard (not that I live in a boat).

    My
    > last design was serverside, and I was just trying to minimise http request
    > and download of web content, but I guess I will have to go back and re-jig
    > the old model.
    >
    > Do you have any ideas on the actual problem of reloading frame pages? It

    is
    > kind of annoying me anyway apart from my problem.
    >
    > Thanks again Spacegirl!
    >


    Not sure there is any easy way around it. Different browsers handle the back
    button in different ways (hmm well, it depends), and you really don't want
    to break the way the browser works just to get around a code glitch. The
    reason everything loads at once is that the pages are being pulled from
    cache, rather than the server, which puts all of your stuff out of sync, I
    suspect. How about you write the data to a cookie, and read it? You could
    easily script the page to check for existence of data in the cookie, meaning
    that you could tell if the user had hit back in their browser etc. You could
    then control the behaviour of the frames.

    I'm not particularly in the "frames are bad" gang, but this one example of
    why handling frames has to be done very carefully if you must use them. We
    have one site we're just finishing up that uses several iframes, which are
    dynamically generated. The client also wanted users to be able to just enter
    a folder, and for the site to display the correct page in the correct place
    on their iframed console. We couldn't have done it purely client side... in
    the end we worked out a method that rebuilds the frameset dynamically - or
    completely from scratch if a user tried to end a daughter page directly. It
    got complicated quickly with all of our other scripts, but thankfully the
    whole lot was pretty much server side, so we wrote a module to handle it
    (especially if the client changes their mind, we'd be in trouble).

    miranda
    SpaceGirl, Apr 26, 2004
    #4
  5. Jarrod

    Jack Cheng Guest

    "SpaceGirl" <> wrote in message
    news:c6hhd5$c0s92$-berlin.de...
    >
    > >
    > > "SpaceGirl" <> wrote in message
    > > news:c6g2ou$bi91p$-berlin.de...
    > > >
    > > > "Jarrod" <> wrote in message
    > > > news:RwLic.54$zc3.50@newsfe1-win...
    > > > > Hi all,
    > > > >
    > > > > I have a bit of a problem.
    > > > >
    > > > > I have several iframes in a page which load successively after the

    > > parent
    > > > > page loads. The idea was to load all my javascript objects and data

    > THEN
    > > > > load the pages that need the data after that. It works fine the on

    the
    > > > first
    > > > > load, but when you refresh or navigate back then forward, all of the
    > > > frames
    > > > > and main page seem to loading at once, which causes an error because

    > the
    > > > > iframes are trying to access data that essentially doesn't exist

    yet.
    > I
    > > > have
    > > > > tried things like checking for the data and relocating if it doesn't
    > > > exist,
    > > > > but that then puts the page in the history.
    > > > >
    > > > > What I want to happen is for the main page to reload/refresh as it

    > would
    > > > the
    > > > > first time. It there a way to "turn off" the frame or something

    (sorry
    > > > that
    > > > > is stupid terminology, but...well you know.)
    > > > >
    > > > > Also, something that might be linked. I have put alerts in some of

    the
    > > > pages
    > > > > and they seem to be getting loaded more than once. I don't quite get

    > > what
    > > > is
    > > > > happening, but I think that the fundamental problem is that I don't
    > > > > understand how the loading of frames work.
    > > > >
    > > > > Any help would be appreciated,
    > > > >
    > > > > Jarrod
    > > >
    > > >
    > > > Sounds to me like you should move all the data from client- to

    > server-side
    > > > and loose all these issues. You could assign all the data to variables

    > in
    > > > whichever server side language your hosts supports, and have each

    frame
    > > read
    > > > the contents of these variables (or, pass them as querystring

    variables
    > > > between each frame). There are plenty of ways of doing this, but

    trying
    > to
    > > > manipulate data client side is asking for trouble. If the users

    browser
    >
    > > > behaves slightly differently, or they have script blocking turned on,

    > what
    > > > happens to your page? If you handle all your data server side, then

    > > there's
    > > > not much the user can do to f*ck up your design.
    > > >
    > > >

    >
    >
    > "Jarrod" <> wrote in message
    > news:AwWic.229$...
    > > Thanks for the info. I will take it onboard (not that I live in a boat).

    > My
    > > last design was serverside, and I was just trying to minimise http

    request
    > > and download of web content, but I guess I will have to go back and

    re-jig
    > > the old model.
    > >
    > > Do you have any ideas on the actual problem of reloading frame pages? It

    > is
    > > kind of annoying me anyway apart from my problem.
    > >
    > > Thanks again Spacegirl!
    > >

    >
    > Not sure there is any easy way around it. Different browsers handle the

    back
    > button in different ways (hmm well, it depends), and you really don't want
    > to break the way the browser works just to get around a code glitch. The
    > reason everything loads at once is that the pages are being pulled from
    > cache, rather than the server, which puts all of your stuff out of sync, I
    > suspect. How about you write the data to a cookie, and read it? You could
    > easily script the page to check for existence of data in the cookie,

    meaning
    > that you could tell if the user had hit back in their browser etc. You

    could
    > then control the behaviour of the frames.
    >
    > I'm not particularly in the "frames are bad" gang, but this one example of
    > why handling frames has to be done very carefully if you must use them. We
    > have one site we're just finishing up that uses several iframes, which are
    > dynamically generated. The client also wanted users to be able to just

    enter
    > a folder, and for the site to display the correct page in the correct

    place
    > on their iframed console. We couldn't have done it purely client side...

    in
    > the end we worked out a method that rebuilds the frameset dynamically - or
    > completely from scratch if a user tried to end a daughter page directly.

    It
    > got complicated quickly with all of our other scripts, but thankfully the
    > whole lot was pretty much server side, so we wrote a module to handle it
    > (especially if the client changes their mind, we'd be in trouble).
    >
    > miranda
    >


    I think it is possible to stop the browser from caching a page with meta
    tags.
    Jack Cheng, Aug 8, 2004
    #5
  6. Jarrod

    brucie Guest

    in post: <news:JHwRc.7852$>
    Jack Cheng <> said:

    > I think it is possible to stop the browser from caching a page with meta
    > tags.


    its not, ultimately its up to the visitor if something is cached or not.

    --
    i h e a r v o i c e s
    brucie, Aug 8, 2004
    #6
  7. Jarrod

    SpaceGirl Guest

    brucie wrote:

    > in post: <news:JHwRc.7852$>
    > Jack Cheng <> said:
    >
    >
    >>I think it is possible to stop the browser from caching a page with meta
    >>tags.

    >
    >
    > its not, ultimately its up to the visitor if something is cached or not.
    >


    That depends on many things. For example, in FireFox, if you try to
    force caching off via your page (preferably via an HTTP header, rather
    than in hte markup), the page files (images etc) are still written to
    disc. However they dont appear to be refered to. If you then loose your
    internet connection... Firefox would repaint the page from disc *unless*
    the page has dynamic data, at which point the HTTP response would fail....

    Not sure how up to the visitor this is, as it's all happening blindly!

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Aug 8, 2004
    #7
  8. Jarrod

    brucie Guest

    in post: <news:>
    SpaceGirl <> said:

    >>>I think it is possible to stop the browser from caching a page with meta
    >>>tags.


    >> its not, ultimately its up to the visitor if something is cached or not.


    > That depends on many things.


    no it doesn't. its your computer, you control what gets downloaded or
    not and what happens with it.

    > For example, in FireFox,


    its easiest to make any changes you want before the goodies get to the
    browser.


    --
    i h e a r v o i c e s
    brucie, Aug 8, 2004
    #8
  9. Jarrod

    SpaceGirl Guest

    brucie wrote:

    >>That depends on many things.

    >
    >
    > no it doesn't. its your computer, you control what gets downloaded or
    > not and what happens with it.


    You missed my point. Not everyone knows how to control these things on
    thier browsers. While you and I know you CAN do these things doesn't
    mean that other people know how to, or are inclined to.

    As the average IE user and they probably wouldn't know what the ****
    "cache" was in the first place, so how can they control it? :)

    >>For example, in FireFox,

    >
    >
    > its easiest to make any changes you want before the goodies get to the
    > browser.


    Uh huh... caching and dynamic forms is a pain in the arse though :( It's
    a shame there is no sure fire way of controlling them. Ah well.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Aug 8, 2004
    #9
  10. Jarrod

    brucie Guest

    in post: <news:>
    SpaceGirl <> said:

    > You missed my point. Not everyone knows how to control these things on
    > thier browsers.


    that doesn't mean that the visitor is not ultimately in control of
    something being cached or not - which they are and is what i said.

    > As the average IE user


    please use the correct terminology - "trailer trash"

    > and they probably wouldn't know what the ****


    i like it when you talk dirty

    > "cache" was in the first place, so how can they control it? :)


    RTFM?

    --
    i h e a r v o i c e s
    brucie, Aug 8, 2004
    #10
  11. Jarrod

    SpaceGirl Guest

    brucie wrote:

    >>You missed my point. Not everyone knows how to control these things on
    >>thier browsers.

    >
    >
    > that doesn't mean that the visitor is not ultimately in control of
    > something being cached or not - which they are and is what i said.


    Only in as much as they could not turn their computer on I guess. Then
    they dont have to worry about those nasty virus either!

    >>As the average IE user

    >
    >
    > please use the correct terminology - "trailer trash"


    or "your customers".

    >>and they probably wouldn't know what the ****

    >
    >
    > i like it when you talk dirty


    Ah baby, you've not heard anything yet :p

    >>"cache" was in the first place, so how can they control it? :)

    >
    >
    > RTFM?


    Yeha right lol


    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Aug 8, 2004
    #11
  12. Jarrod

    brucie Guest

    in post: <news:>
    SpaceGirl <> said:

    > Only in as much as they could not turn their computer on I guess. Then
    > they dont have to worry about those nasty virus either!


    if people get infected then its their own fault. its their computer
    they're in control.

    >> please use the correct terminology - "trailer trash"

    > or "your customers".


    "trailer trash customers" - cash only

    >> RTFM?

    > Yeha right lol


    i can dream

    --
    i h e a r v o i c e s
    brucie, Aug 9, 2004
    #12
  13. Jarrod

    Webcastmaker Guest

    In article <>,
    says...
    > please use the correct terminology - "trailer trash"


    And what is wrong with trailer trash?

    --
    WebcastMaker
    The easiest and most affordable way to create
    Web casts, or put presentations on the Web.
    www.webentations.com
    Webcastmaker, Aug 9, 2004
    #13
  14. Jarrod

    brucie Guest

    in post: <news:>
    Webcastmaker <> said:

    >> please use the correct terminology - "trailer trash"


    > And what is wrong with trailer trash?


    i was one for a few years. i rest my case.

    --
    i h e a r v o i c e s
    brucie, Aug 9, 2004
    #14
  15. Jarrod

    SpaceGirl Guest

    brucie wrote:

    >>And what is wrong with trailer trash?

    >
    >
    > i was one for a few years. i rest my case.
    >


    ....and it all becomes clear.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Aug 9, 2004
    #15
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antonio Delgado

    Refreshing Iframes

    Antonio Delgado, Aug 18, 2003, in forum: HTML
    Replies:
    0
    Views:
    466
    Antonio Delgado
    Aug 18, 2003
  2. Mike Grace
    Replies:
    1
    Views:
    1,916
    Brock Allen
    May 12, 2006
  3. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    445
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  4. ritika_v
    Replies:
    1
    Views:
    282
    ritika_v
    Apr 1, 2008
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    179
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page