View Full Version : making a page that refreshes
ignoranceisblis
01-30-2005, 09:17 PM
I was wondering if anyone knows how to constantly display the contents of a file to the screen
I have a page that opens a file and reads it line by line, then shows the results, but the file changes by the second, how could I make the page show the update immidietly?
mlseim
01-30-2005, 09:33 PM
You can use a Javascript (see link below).
Perl can be used to build the HTML file with the Javascript
also included within the file. It should render and operate
on the visitor's browser. Because your Perl script creates
and displays the HTML, the refresh will actually re-run the
script (itself) ... pretty neat.
http://www.javascriptkit.com/script/script2/autofresh.shtml
I made a test example for myself ... it is a Perl script with
the Javascript snippet (put in the <head> </head> portion).
See the timer on the bottom of the browser - status line.
When it expires, the script re-runs.
My example:
http://www.catpin.com/cgi-bin/test6.pl
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.