My answer uses PHP and Ajax, although switching to ASP or any other language will not be hard.
In the head
<script type="text/javascript"> function Ajax() { var $http, $self = arguments.callee; if (window.XMLHttpRequest) { $http = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { $http = new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) { $http = new ActiveXObject('Microsoft.XMLHTTP'); } } if ($http) { $http.onreadystatechange = function() { if (/4|^complete$/.test($http.readyState)) { document.getElementById('ReloadThis').innerHTML = $http.responseText; setTimeout(function(){$self();}, 1000); } }; $http.open('GET', 'loadtxt.php' + '?' + new Date().getTime(), true); $http.send(null); } } </script>
In organism
<script type="text/javascript"> setTimeout(function() {Ajax();}, 1000); </script> <div id="ReloadThis">Default text</div> </body>
Now, using loadtxt.php, read the values โโof the text file
<?php $file = "error.txt"; $f = fopen($file, "r"); while ( $line = fgets($f, 1000) ) { print $line; } ?>
neo
source share