Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG  Not logged in ELOG logo
Entry   JavaScript list auto-refresh, posted by Emiliano Gabrielli on Fri Jul 8 17:34:02 2005 
    Reply   Re: JavaScript list auto-refresh, posted by Stefan Ritt on Tue Aug 23 12:07:51 2011 
Message ID: 14     Entry time: Fri Jul 8 17:34:02 2005     Reply to this: 36
Author: Emiliano Gabrielli 
Author Email: AlberT@SuperAlberT.it 
Category: Script 
Subject: JavaScript list auto-refresh 
Status: Stable 
Last Revision: Tue Jul 12 12:36:16 2005 by Emiliano Gabrielli 
Here is a simple piece of JS code to accomplish a smart page reload.
We don't reload if in some kind of editing mode.

You can put the code everywhere you like in the elog html page, my suggestion is to put it in Bottom Text (or Top Text):

;auto-refresh
Bottom text = [I]<script language="JavaScript">if (null==window.location.href.match('/[0-9]+$|.*(cmd|select)=.*') ) { window.setTimeout("location.reload();", 2*60*1000); now=new Date(); document.write('<br/>Last reload at '+now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+', '+( ((h=now.getHours())<10) ? '0'+h :h)+':'+( ((m=now.getMinutes())<10) ? '0'+m :m)+':'+( ((s=now.getSeconds())<10) ? '0'+s :s)) }</script>[/I]


the timer is a product of # of minutes, #of seconds and milliseconds... 2 minutes in the above example Smile



Revision Tue Jul 12 12:36:16 2005 wrote:

modified regular expression in order to not activate the auto-refresh in the signle entry view
ELOG V3.1.5-fe60aaf