PDA

View Full Version : Frequently changing text on all pages without refreshing everything.


NormanRouxel
21-Apr-2003, 11:18 AM
A client recently wanted to display the date and time the site was updated (not the time viewed) on all pages. The software that updated the site wrote a file DateTime.txt containg that info as a simple bit of text. Loading this into Act_Primary.html via:-

NETQUOTEVAR:INCLUDE DataTime.html

worked but meant that EVERY page had to be refreshed every upload.

A workaround that overcame this was:-

The code that wrote DateTime.txt added the following around the text:-

document.write('DATETIME');

where DATETIME is the bit that changes. And the code in Act_Primary becomes:-

<SCRIPT LANGUAGE="JavaScript" SRC="DateTime.html" TYPE="text/javascript"></SCRIPT>

Voila! No more entire site updates.

Norman