Obtain header and rest of paragraphs from a text file

masc1455's Avatar, Join Date: Oct 2009
Newbie Member
Is there a way of doing this with java script?

I have a homepage, that has to go to a certain directory, find the newer TXT file, get the first paragraph, get it formated with H1 tag, then read the rest format it with a P tag.

So everytime a new TXT file is created in that directory the homepage (HTML/index.html) change.

Thank in advance

Miguel Sanchez
ManzZup's Avatar, Join Date: May 2009
Skilled contributor
write the js screipt:

1) read the text file into a stream of text ( i mean line by line)
spcify to which line you want the text to be

2) uuse 2 variables and assgn the text to the h1 and p

then use document.write() method to write it into the html poage

ATTACH the js to the html page
(rem to put the read fuction to the winod.onlad thng)