1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Obtain header and rest of paragraphs from a text file

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

  1. masc1455

    masc1455 New Member

    Oct 11, 2009
    Likes Received:
    Trophy Points:
    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

    May 9, 2009
    Likes Received:
    Trophy Points:
    Production Manager:Software @ ZONTEK
    Sri Lanka
    Home Page:
    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