Apologies, I'm sure there is a simple solution for this. But after 2 days searching, I can't find the right answer.
The basics: I want to pull a string from a plain text file (.txt) that is live and online, uploaded to my server (src="example.txt") and insert that string into a webpage on that same site ("page.html").
More details: My site is very basic. It allows readers (language learners) to listen to audio of a reader, while the site highlights the passages being read. So the plain text files in question are text/audio timing codes for dialog subtitles, and I'm trying to automatically generate the HTML from them so I don't have to insert the text + span codes into each HTML page individually (there are a lot of them). I have a very simple script that turns the subtitle timing codes into simple tags for HTML, and those text strings are what need to be read from the txt file, and inserted into a p tag in the HTML page. There is nothing else in the txt file.
The closest result I have found to my query is here. The and solutions are no good, as I don't want the content embedded — I need the unicode text string inserted in my HTML so it can be read by the script for the read-along highlighting. The Javascript suggested here, upon testing, doesn't work.