guestbook auto refresh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I use a guestbook in my web and would like users to see their addition
without having to refresh the page. Is there a way to do this or perhaps a
javascript - the only one I have seen seems to refresh after a set amount of
time not just once only on reloading the page from a link. Does that make
sense to anyone?
 
You must refresh the page to see the additional content. This can be
done by a link on the page, or a link on the confirmation page, which
reloads it from the server - example: <a
href="guestbook.htm?">Refresh</a>
The "?" in "guestbook.htm?" ensures that the page will reload from the
server, and not from any cache or proxy server.
The confirmation page, if a custom page, could also have a <meta
refresh that automatically reloads the guestbook after a reasonable
time delay
In the <head> section of the confirmation page add
<meta http-equiv="Refresh" content="20;url=guestbook.htm">
which gives a 20 second delay. Also add a link as before.
 
Thanks Ron, Yep - Tried it and it works! - Can I also direct the refresh
command on the confirmation page back 2 pages (history(-2) ) s i have a
complicted guestbook arrangement that uses the same confirmtion page for a
number of different forms and results pages. If so, how is the code formatted.
 
javascript:history.go(-2) will not refresh the page from the server,
it will reload from the cache or computer memory - the same as
pressing the back button twice.
To refresh a page you must reload that page from the server, and the
easiest way is to provide a link to the page.
In your "one-confirmation-page-for-multiple-forms" scenario, you would
need a link for the guestbook (and discussion web, if you use it) to
refresh it, and an ordinary back button <a
href="javascript:history.go(-1)">Back to form</a> for other forms
(refreshing these pages will destroy the form information the user
filled in).
It will probably be easier (for the user) to use a specific page to
confirm the guestbook posts, and a different page for other forms'
confirmation.
 
Back
Top