Announcement

Collapse
No announcement yet.

Frequently changing text on all pages without refreshing everything.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Frequently changing text on all pages without refreshing everything.

    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
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey
Working...
X