Forum Home
Press F1
 
Thread ID: 70210 2006-06-25 23:03:00 javascript updating page, Javascript help Morgenmuffel (187) Press F1
Post ID Timestamp Content User
466084 2006-06-25 23:03:00 Hi all

I currently have a dynamically generated page (php) where my client adds pictures as part of an online course,

What i want is that when the teacher adds a new image (every 5 - 10 mins or so) for the pupils pages to update,

Currently what I have is a meta tag refresh that refreshes the pupils page every 5 minutes

now because the page is dynamically generated (shows the 2 most recent images), i think checking it with javascript would create the same sort of server work as the meta tag refresh, So i had the cunning plan that i could use javascript to check the images directory, and when a new image was added it would refresh the page, or even make a "refresh" button appear on the page
The images are numbered as they are uploaded so the first image uploaded will be image1 the next would be image2 etc,

Now i dont really understand javascript or its abilities, but I thought to tackle this one of 2 ways
get the javascript to check the number of items in the images directory (and store it as a variable), when it increases, the page refreshes
get the javascript to check the most recent creation date in the images directory (and store it as a variable) and when a newer date appears refresh the page

If any one can help i would be exceedingly grateful

Cheers
Nigel
Morgenmuffel (187)
466085 2006-06-26 06:40:00 Ok even if you don't know how to do this, but you know a good (read idiots) guide to javascript refresh check/function let me know

as I'm reading through dozens of links and not finding it

Cheers
Morgenmuffel (187)
466086 2006-06-28 14:24:00 Not much luck here, eh Nigel?
Maybe a bump would help...
Laura (43)
466087 2006-06-29 04:05:00 At a guess you probably want to use something like XMLHttpRequest (en.wikipedia.org). gibler (49)
1