Web Development Thread, Automatically refresh a webpage ONLY when content has changed? in Coding and Web Development; Hey there,
14th February 2008, 01:13 PM #1
Automatically refresh a webpage ONLY when content has changed?
I've also written a simple interface to update the contents.htm file using FCKeditor, but at the moment to get it to display the new contents requires a manual refresh of the webpage, which isn't ideal. (the screens for this are going to be fairly high up on a wall, and the PC is going to be the other side of the wall)
Any ideas gratefully received.
IDG Tech News
14th February 2008, 01:16 PM #2
perhaphs you could do it with AJAX?
14th February 2008, 01:57 PM #3
- Rep Power
You can do this within HTML. In between the <head></head> tags add the following
<META HTTP-EQUIV="refresh" CONTENT="300">
This will reload the page every 5 mintues, the CONTENT is in seconds, so you can change this accordinly.
14th February 2008, 02:19 PM #4
The OP specifically said he didn't want a timer like that.
Mind you, I don't have a better solution other than suggesting a manual refresh if its only modified once or twice a week as opposed to making something complicated which needn't be.
14th February 2008, 02:46 PM #5
Originally Posted by maniac
14th February 2008, 02:50 PM #6
Ajax feels like the right answer (it's a good buzzword so it must be right :-))
The other thing might be to have a script running which checks to see if there's new content every 5 minutes. If it finds new content then it refreshes the browser.
Code below is not complete - I don't know how you will determine if there is new content but I'm guessing you'll query a database for a "last updated" field??
Do While (oIE.Busy)
wscript.sleep 5*60*1000 ' sleep 5 minutes
'code here to query database for new content
if bNewContentFound then
By boomam in forum Windows
Last Post: 7th January 2008, 10:52 AM
By techyphil in forum Windows
Last Post: 26th November 2007, 09:28 PM
By russdev in forum Scripts
Last Post: 8th August 2007, 05:34 AM
By TechSupp in forum How do you do....it?
Last Post: 12th April 2007, 12:05 PM
By Grommit in forum Windows
Last Post: 4th December 2006, 10:55 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)