View Full Version : Display a text file in webpage

02-24-2012, 04:58 PM
I have the ability to remotely upload a text file to a folder on my web server.
Periodically during the day I update that file and re-upload it which overwrites the previous file.

I am looking for a script to insert in a webpage that will "get" and display
the current version of that file on page load.

Thanks in advance.

Philip M
02-24-2012, 05:13 PM
AJAX. For a good explanation and example see


Many examples in the Ajax section of this forum, e.g.


var myvar = "";
var http = XMLHttpRequest();
http.open('GET', 'datatextfile.txt', true);
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200)
myvar = http.responseText;
http.send(null);All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.