refresh part of page

Discussions

Web tier: servlets, JSP, Web frameworks: refresh part of page

  1. refresh part of page (6 messages)

    There are serious of pictures I want to display in web page.
    The pictures will be refreshed in 30 seconds. How can I refresh part of web page(picture part)?

    Threaded Messages (6)

  2. refresh part of page[ Go to top ]

    All of the solutions to this involve some level of client side development. I'm not much of a web-weasel but I think the easiest solution is probably to use an HTML frame. Each frame in the window can be refreshed or loaded independently.

    Evan.
  3. refresh part of page[ Go to top ]

    The safest way to do this is using frames and framesets. This method is often used to rotate banner adds. This is supported on all recent web browsers.

    The other method would be to use a small Java applet which rotates the image. It isn't as safe (since all browsers don't have Java turned on), but it saves you the hassle of doing HTML development using frames -- which can be a pain.

    Kind of a 'pick your poison issue'. Best of luck.

    -- Rick
  4. refresh part of page[ Go to top ]

    Rick, I haven't used framesets much. I'm wondering, would Mat be able to use the <meta http-equiv="Refresh" content="30">? Would that refresh just that frame, or is there some other mechanism you'd use?

    Thanks,

    Gordon.
  5. refresh part of page[ Go to top ]

    Basically, the approach you are speaking about is the frameset approach. A simple example would be a two frame webpage. The top frame contains a banner and some header information. It has a meta 'refresh' tag in it which will reload itself every 'n' seconds -- which is what you described. The bottom frame would be the content which wouldn't refresh itself.

    The HTML code for the page would look something like the following:

    <html>
      <head>
        <title>Frame Sets</title>
      </head>
      <frameset rows="95,*" framespacing="0" border="0">
        <frame src="refresh.html">
        <frame src="norefresh.html">
      </frameset>
      <noframes>
        You are using an old browser.
      <body>
      </body>
      </noframes>
    </html>

    That's basically it in a nutshell. The 'refresh.html' would have the refresh tag, and the 'norefresh.html' wouldn't.

    -- Rick
  6. refresh part of page[ Go to top ]

    Rick, thanks for the explanation.

    Gordon.
  7. refresh part of page[ Go to top ]

    As everyone says this can be done easily using frames. But frames requires amount of recoding and setting the references. Another way of doing it is through some client side scripting, like Javascript. You can load all images in a cache, more specifially an array, when the page loads;
    then using Javscript you can change the image after every 30 secs. In this case the pages doesn't reloads only picture will be changed.
    I think this solution meets you requirement.