I have 3 files the "root" is my github, so they're all online:
Root/blah/blah/index.html
Root/blah/blah/document.txt
Root/blah/blah/script.js
I want the .js to turn the contents of the .txt into a set of strings separated by the word "END" and print all the strings inside their own <p> </p> in the simplest possible javascript.
I feel like this is really basic but I looked forever for the simplest solution and all the answers are way too complicated or rely on a local text file being uploaded by the user.
All my files are in the same directory.
Sorry if my question is bad. It's my first.
The .txt file could be an html file if that's easier.
I would want the .txt file separated once it got to the word "END" example.txt:
The quick
END
Brown Fox
END
And have that turn into
<p>The Quick</p> <p>Brown Fox</p>
The Quick
Brown Fox
. I'm not sure what to use, but Ideally once I linked the script.js in my index.html, it would print all the entries from the .txt up to the "END." – Joseph Goulette Nov 24 '20 at 18:01` elements for each region of text that you identified. (This will depend on the framework you are using. e.g.: React or jQuery or plain JS or whatever.)
– Wyck Nov 24 '20 at 19:46