Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JSP (http://www.go4expert.com/forums/jsp/)
-   -   Obtain header and rest of paragraphs from a text file (http://www.go4expert.com/forums/obtain-header-rest-paragraphs-text-file-t19737/)

masc1455 11Oct2009 11:08

Obtain header and rest of paragraphs from a text file
 
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 25Jan2010 20:02

Re: Obtain header and rest of paragraphs from a text file
 
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)


All times are GMT +5.5. The time now is 23:52.