Obtain header and rest of paragraphs from a text file

Discussion in 'JSP' started by masc1455, Oct 11, 2009.

  1. masc1455

    masc1455 New Member

    Joined:
    Oct 11, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    http://zontek.zzl.org
    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)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice