Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    D3Z
    D3Z is offline
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Searching and Writing a text file

    Is there anyway in which i can search a .txt file and write the data to a web page using html or javascript at all? if so could somebody please help.

  • #2
    New to the CF scene
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No but yes

    I just read an article that gave some good workarounds tho, if you are wanting to read text then put it into a javascript file... ".js" and link it to the page, then make functions to pull it out....what is the main purpose of reading...now writing....that may be a different story. The articles I read were from this web page http://www.irt.org/script/file.htm it basically mentions that javascript is a "client side" program, so anything you do with a text field will be done on the user's computer and will act more like a cookie...but if you are interested just attach apache and learn php...or per...it will do that in a jiffy.

    Ry

  • #3
    D3Z
    D3Z is offline
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cheers for that. SO your saying there is no way without using php or perl to read and present data from a text file? okies cheersa anyway

  • #4
    Regular Coder
    Join Date
    May 2005
    Location
    lincolnshire
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i think youll have to use server side

    I have not heard of a way of doing this, good question!

    really easy to whip up in ASP!

    so i have no answer then, sorry

  • #5
    New to the CF scene
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Client Side

    Javascript has many purposes but since you are doing client side programming when u use js it really cant help you on the server side, thats why they have made server side languages...but you can use ssi (Server Side Includes) if you are having issues with other languages...These can be done with most server side languages...but they are more for headers and footers, but with vbscript you can mess around with the included text, I really havent given it much thought because of the dynamics you get when you use a server side language you really dont need to read from a text file in javascript...I guess thats all...sorry to disappoint you...what were you looking to do with it tho???

  • #6
    New to the CF scene
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How big is the text file?

    If it is not too large then what you could do instead is to load this text into the page in a hidden area, say
    <div id=hiddentext" style="display: none">
    Then, search this div and print the results where you need them.

    If the text makes the page too large, then this solution is too slow to be useful.

    cheers
    jean


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •