D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] OT: Could anyone help with a bit of Javascript please?

 

On Monday 16 June 2008 20:56, Rob Beard wrote:
> Hi folks,
>
> I'm currently in the process of putting together a simple(ish) web page
> to display a couple of frames and have an updating ticker box on there
> which reads the contents to display from a text file on the server.
>
> Now I've been playing around with this which does pretty much what I
> want...
>
> http://www.dynamicdrive.com/dynamicindex2/ajaxticker.htm
>
> When the page loads and the script runs, it loads the contents of the
> text file into the memory and then goes through each item one after the
> other.  However, what I want is something that will automatically update
> itself, so if for instance anything gets added to the text file that it
> picks it up when it cycles through again.
>
> At the moment to get it to do this, I've put some javascript in the main
> page with the ticker on that just refreshes the page every 60 seconds
> (refresh as if the user had pressed the F5 key).  This however causes a
> very quick flash on the screen when the page reloads which is a slight
> bit annoying.
You could turn your 'page' into a two part xml file - one part being the time 
change of the page. If the page has been changed since it was last read 
( datepart != saved_datepart) the load the new data into the array. You can 
obviously extend this to  <infoblock><datechanged/><data>blah 
blah</data></infoblock> for multiple data items should you wish
Tom te tom te tom


-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html